How to stop short circuting of validation rules completely for a particular bo

How to stop short circuting of validation rules completely for a particular bo

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


Vinodonly posted on Tuesday, August 18, 2009

I have a collection which is having total qty and each row in turn is having a breakdown of qty..

Both should tally.. If total qty is say 5000 and breakdwon is in 2 rows of 2500 each then any change should run the validation rules..

I'm currently using listchanged event and validation is working but sometimes due to short circuiting feature, validation rules are not triggered..

For the time being, i'm manually putting a dummy value and changing it back to original value to force the check but this is not the right way..

How i can complete disable the short circuiting part so it shud get executed all the time..

ajj3085 replied on Tuesday, August 18, 2009

I though you had to set things up to short circuit, because it should run all the rules by default.

You might also consider changing the priorities of certain rules, so that the always run ones are at 0, and the others an be higher.

Vinodonly replied on Tuesday, August 18, 2009

i also thought the same but somehow this is not happenning..

i will just go through my code again and post back the final comments..

Kindly note throughout this po, i have not set any priorities so all are having default value of 0..

JoeFallon1 replied on Tuesday, August 18, 2009

Sometimes I override IsValid and call specific rules like: CheckRules("Qty") to re-run any rules that need to be checked before determining if the BO is valid or not.

I do exactly this for my PO Line BO which has a Splits collection of split line BOs. So if the line has a qty of 5000 and the Splits colelction has two records of 2500 each the Qty rule in the PO Line BO will get re-run whenever you ask it if itis valid or not. That rule will compare the sum of the qty in the splits collection to the Qty in the PO Line.

Joe

 

Copyright (c) Marimer LLC