brokenrules

brokenrules

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


yh_ink posted on Friday, October 13, 2006

I just wan tto clarify one thing about brokenrules.

I set all the brokenrules in my business properties region.what i want to know is when i call the class for the first time in my constructor i want to set all my broken rules to be true.that is make it list the brokenrules  which i had set or just invalidate my object.

How can i do that????

 

 

ajj3085 replied on Friday, October 13, 2006

So you're setting up the rules in AddBusinessRules override..right?

If that's the case, then just before your DataPortal_Whatever method ends, you call ValidationRules.CheckRules()  This will run all the rules to figure out which ones are broken.

HTH
Andy

yh_ink replied on Friday, October 13, 2006

Let me put it this way.I am no talking about Checkrules();

First when a particular class is called the constructor is called.In the constructor i want to break the rules or i want to prevent direct creation.Or what i want is object should not to a valid object when i call it.

Michael Hildner replied on Friday, October 13, 2006

Hi yh_ink,

I'm having trouble understanding what you want to do. Are you saying that you want your object to be invalid when it is created?

If so, what Andy said is correct. Call ValidatonRules.CheckRules() in DataPortal_Create.

An object is not valid if one of the rules is broken. So if all your rules are satisfied, it's valid. You'd have to break a rule to make it invalid.

I think it would help if you described your use case, or what you need to accomplish in general.

Regards,

Mike

Copyright (c) Marimer LLC