Validation confusion

Validation confusion

Old forum URL: forums.lhotka.net/forums/t/911.aspx


Michael Hildner posted on Tuesday, August 15, 2006

Hi,

I have an Editable Child class that has a single CommonRules.StringRequired rule.

I've been using this class for a while (creating new), and it saves ok, even though this property is never populated.

So, I've gotten around to fetching. In my Fetch method, there's a ValidationRules.CheckRules() call. When I fetch, the object is not valid, which makes sense.

Why is the object valid when I create a new one and save? I'm not sure what to look at to track it down.

Thanks,
Mike

razorkai replied on Wednesday, August 16, 2006

Hi Mike.

It is quite common to have ValidationRules.CheckRules in your object's DataPortal_Create method after populating any default values.  See page 423 of the book.

HTH.

John.

Michael Hildner replied on Wednesday, August 16, 2006

Thanks John, helps a bunch. I appreciate the book reference - it's explained quite nicely in there.

Regards,

Mike

Copyright (c) Marimer LLC