Trent L. Taylor (11/13/2007)
More than likely you are not calling the Save() method on the form but rather on the BOs individually. The InfoBox will not appear when the Save() on the BO alone is called. You can call the CheckRules on the BO (which it might display them, I cannot remember off of the top of my head) or just make the call to Save() of the form which will force this logic. Hi Trent,
Yes, you are right, I am calling the BO.Save() because I want to control the saving of parent and child separate, so I had the form's property IncludeInFormSaveType = AllBusinessObject, when I originally had the value PrimaryBusinessObject in order to avoid the main toolstrip menu to react when a child BO was changed.
Now using IncludeInFormSaveType = AllBusinessObject shows the InfoBox when there is a broken rule on the child BO, but it shows the wrong numbers of broken rules, see picture attached.
The help file does not says anything about all SF properties and methods, so it is a bit hard for a newbie like me to figure things out but I will rather keep the BO states separate from the Primary BO, so the question would be... Is there another way to show the InfoBox when there is a broken rule in any BO?
I don't know why it i s done this way, but I believe the functionally of the InfoBox and the Broken rules should work the same for any BO and not just from the form's save method.
Here is the code I originally had in the form and would like to keep:
If Me.ServiceCallsAppliancesBO1.CheckRules(True) Then '-- Save the child record and set the focus back to the listview.
Me.ServiceCallsAppliancesBO1.Save()
Me.lvAppliances.Focus()
End If
Edhy Rijo