Error Saving not firing


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Hmm I had broken rules, so if broken rules exist that trumps ErrorSaving?

Yes, but you can handle the BusinessRulesChecked event and set the e.IgnoreRulesAndForceSave to True and any rules will be ignored....if you have this need.

Can I easily display the BrokenRules collection to the user if the BO is not the forms PrimaryBusinessObject or will I have to code for that?

Sure, we do this in our medical app so that they can tell when there are broken rules on other pages as well as on web applications.  You can just enumerate the BrokenRules collection (either on the BO or in the BusinessRulesChecked event)

Dim msg As String = ""
For each rule as BusinessRules in MyBo.BrokenRules.ToArray()
    msg &= rule.FieldName & ControlChars.CrLf & rule.Description
Next

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Keith,



I'm not sure on this, but I'd check out the SaveByForm() method of the BO. The broken rules handling is done by the standard form, so if the BO is on the form, I think using the SaveByForm() method will get the broken rules shown.
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Can I easily display the BrokenRules collection to the user if the BO is not the forms PrimaryBusinessObject or will I have to code for that?

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Hmm I had broken rules, so if broken rules exist that trumps ErrorSaving?

Keith Chisarik
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I have a BO declared as

Private WithEvents BO As BOLIB.BO = New BOLIB.BO

I add records, then set ErrorSavingMode to ContinueOnError

BO.ErrorSavingMode = MicroFour.StrataFrame.Business.ErrorSavingOptions.ContinueOnError

Calls to BO.SAVE() fail, but ErrorSaving does not fire to tell me what is going wrong. I added code to other methods on the BO (AfterAddNew) and they fire as expected, what might be causing ErrorSaving not to fire?



Keith Chisarik
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