StrataFrame Forum

Checking Conflicting Rules

http://forum.strataframe.net/Topic27373.aspx

By Bill Cunnien - 6/10/2010

I have a packing list detail business object that adds a broken rule whenever it detects that the detail has been included on an invoice. Users are not allowed to edit the packing list detail once it has been invoiced. Pretty normal business rule.



If a shipment is late, a reason is posted to the packing list detail. At times, the shipment has gone out and the items have been invoiced, but it really wasn't shipped late...someone forgot to change the ship date, or whatever. Now, a sales person reviews a late shipments report. He sees the invalid reasons and wants to modify the packing list detail to change the late reason back to 'None'. That seems reasonable.



Outside of simply stating that mistakes like this should be allowed to stand and learned from for the future...how do I allow a user to change one field on a BO when a constraint is in place to disallow changes? Is there something in the BO that tracks which fields have changed? If so, I could easily check to see if only the late reason is being changed, then allow the save. I am not seeing anything like that in the BO.



I hope I am making myself clear. I have only had two cups of coffee, so far. BigGrin
By Edhy Rijo - 6/10/2010

Hi Bill,



Looks like this is a very specific condition, so what I would do is this:



Add a commandbutton to call a child form dialog with the fields that needs to be change and save the BO normally, of course it will only save those fields changed in the child form.



With this approach you can even create a security permission for the button so only those with the required permission will be able to use it.
By Bill Cunnien - 6/10/2010

Tie it to an RBS permission key...not a bad idea. Thanks!!
By Edhy Rijo - 6/10/2010

Bill Cunnien (06/10/2010)
Tie it to an RBS permission key...not a bad idea. Thanks!!




You are welcome!



Also keep in mind that you have to manually set the commandbuton.Enabled based on the check of the permission somewhere in your code logic. I use that in several of my projects and it works beautifully and very easy to implement with the childformdialog control.