BO Error Validation


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
Thanks. It is helpful to know that by the time the BeforeSave occurs on the BO, that the Broken Rules have already been checked. I just added my default logic into the BO CheckRulesOnCurrentRowto run ahead of the of the code that generates the AddBrokenRule.

I would have put this logic into the SetDefaultValues except, I do cannot run that logic until the user fully fills out the form, then when they click on SAVE I can then run my default logic which then lets me know if certain rules required the user to enter other information.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is my assumption correct?

Yes.

If so, how can I check the rules in the BeforeSave event and if an error cancel the SAVE and display the error?

You will want to handle the BusinessRulesChecked event as this will give you what you need and allow you to even force a save if you so choose.

Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
I have a BO that has logic to automatically display broken rules. On the form, in the BO BeforeSave event the code automatically populates several columns and then I need to fire off the check rules on the BO. It appears as though the BO check rules is being fired before the "BeforeSave" event of the BO on the form. Is my assumption correct? If so, how can I check the rules in the BeforeSave event and if an error cancel the SAVE and display the error? Also, this only occurs when I am adding a NEW row to the table. When editing an existing row, the broken rule displays.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search