BeforeDeleteEventArgs


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

I'd like to see a property added to the BeforeDeleteEventArgs to indicate if the delete is deferred (marked as deleted) or immediate. I’d like to be able to add some code to the BO to delete related records in other tables. Since a record marked as deleted can be undone I would want to wait and delete the related records in the BeforeSave event handler of the BO. If the BO is being deleted immediately I need to delete the related records in the BeforeDelete event of the BO to avoid constraint errors.

-Larry

 

Replies
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
Looking at the source code, it would seem that the easiest thing to do would be to add the OnlyMarkAsDeleted parameter of the DeleteCurrentRow method as a ReadOnly property on the BeforeDeleteEventArgs.

Also the Developer's Guide states the DeleteCurrentRow() deletes the record from the server immediately. However when I look at the source code

Public Function DeleteCurrentRow() As Integer
      Return DeleteCurrentRow(False, True)
End Function

CheckSecurity is being set to False and OnlyMarkAsDeleted is being set to True.

-Larry


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: 6.9K
The method you placed in the previous post was not the overload that respects the "OnlyMarkAsDeleted" parameter.  By default, the record is only marked as deleted, not smoked from the server until the Save is called.  But regardless, I agree with the event arguments.  This is an easy fix and we will get it in the official release of 1.4.1.

Thanks for your input! Smile

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