StrataFrame Forum

BrokenRule On Delete

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

By Brad Vick - 10/4/2006





I noticed the checkrulesoncurrentrow does not get called on a Delete. I need to be able to show a broken rule or a popup error when the user tries to delete if certain conditions are met. What is the recomended method to accomplish this?
By Trent L. Taylor - 10/4/2006

Generally there is no need to check rules before a record is deleted, but you can force the rules to be checked yourself.  Just call this method:

If MyBo.CheckRulesOnCurrentRow(True) = Success Then
    '--- Delete your record...or not Smile
End If

By Brad Vick - 10/4/2006





Thanks Trent. 1 more question regarding this. How can I determine if I am in delete mode inside my CheckRulesOnCurrentRow event? I want to check certain rules depending on wheter I am in edit, add, or delete mode.
By Trent L. Taylor - 10/4/2006

I really don't know what you mean by delete mode.  Business objects do not have an editing state of Delete.  Now if you delete a record within the BO and the changes have not been committed back to the server, you can just look at the current rows state:

MyBO.CurrentRow.RowState = Deleted

But for this to show up, you will have to allow the deleted rows to be visible (property on the BO).

By Brad Vick - 10/4/2006



Thanks I got it.