Infobox not showing for a related BO broken rule


Author
Message
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
When you call the CheckRules() method, it checks the rules on all of the business objects, so, if there are broken rules on child business objects, it adds the counts together from all of the business objects (that's why you're getting a 2).  So, I would recommend leaving the code like you had it (where the InfoBox won't pop up on its own) and instead, add a handler to your primary business object's BusinessRulesChecked event on the form.  In that event handler, if the event args says the count of broken rules is greater than 0, then show an InfoBox with the message that you want to show.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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 Wink 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

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
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.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

I have a Mainteanance Form with two Business Objects, a parent and a child on the same form.  When trying to save a parent record the broken rule functionality shows the red arrow and infobox properly, but when doing the same thing with a child record, only the red arrow is shown and not the infobox.

Is there something I need to do in order to get the infobox to show for the child BO when a broken rule validation is triggered?.

Please see both images to see what I meant....

Thanks!

Edhy Rijo

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