Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Business Object Clears rules when AutoClearRules = false
Message
From
19/06/2008 13:00:30
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Business Object Clears rules when AutoClearRules = false
Miscellaneous
Thread ID:
01325495
Message ID:
01325495
Views:
70
I have a Business Object that I populate on the fly with new records. I have its AutoClearRules property set to False. During the process of populating this Business object I check for a condition that may invalidate the row. If I find the condition then I add a broken rule to the rulesprovider like so.
Dim dsEP As DataSet = Me.ExportDetailBO.GetCurrentDataSet
  mmerrrorprov = New OakLeaf.MM.Main.Business.mmErrorProviderArgs(dsEP, Me.ExportDetailBO.TableName, _(Me.ExportDetailBO.GetRowCount - 1), "DLN", "has an unresolved Void Request. ", False)
  
 Me.ExportDetailBO.Rules.AddErrorProviderBrokenRule(mmerrrorprov)  
Lets call this step 1.
At this point everything is fine the rule shows up in the error provider and the Broken rules count reflects the change.
Later in the process this Business object along with others attempt to save the data via the Business Objects save() method.
Lets call this step 2.
When saving the Business object fires its checkrules logic, this is checking additional rules related to the data the Business Object is saving. If one of these rules fail than it behaves just as one would expect. The broken rules from this step are added to any rules that where broken during step 1 and returns rulesfailed save result.
However if no rules from step 2 fail then saverulespassed is returned and the rules provider is empty with no broken rule count .

While troubleshooting this I did checkrules() from the business object instead of a save() then everything is back to working correctly regardless whether an of the rules in step 2 failed.
Next
Reply
Map
View

Click here to load this message in the networking platform