| | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 10/10/2008 3:41:17 PM Posts: 363, Visits: 1,805 |
| 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 |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 3:06:58 PM Posts: 4,599, Visits: 4,576 |
| Good suggestion. |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 10/10/2008 3:41:17 PM Posts: 363, Visits: 1,805 |
| | 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 FunctionCheckSecurity is being set to False and OnlyMarkAsDeleted is being set to True. -Larry |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 3:06:58 PM Posts: 4,599, Visits: 4,576 |
| | 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! |
| | | | 
StrataFrame User
       
Group: StrataFrame Users Last Login: 10/10/2008 3:41:17 PM Posts: 363, Visits: 1,805 |
| | I realize the the method that I referenced in my previous post in not the overload that includes the OnlyMarkAsDeleted parameter. I was just trying to point out that the documentation doesn't agree with the code. The following quote is from the developer guide. "DeleteCurrentRow() - When this overload is called, the record being deleted is immediately removed from the server and the internal data table is updated." -Larry |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 3:06:58 PM Posts: 4,599, Visits: 4,576 |
| | Oh, I follow what you are saying. Thanks for pointing this out...we will get it fixed. |
| |
|
|