StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



BeforeDeleteEventArgsExpand / Collapse
Author
Message
Posted 06/12/2006 4:03:16 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 9:59:14 AM
Posts: 361, Visits: 1,767

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

 

Post #1511
Posted 06/12/2006 4:35:59 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
Good suggestion.
Post #1514
Posted 06/12/2006 4:56:59 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 9:59:14 AM
Posts: 361, Visits: 1,767
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

Post #1515
Posted 06/13/2006 9:08:31 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
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!

Post #1518
Posted 06/13/2006 10:43:20 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 9:59:14 AM
Posts: 361, Visits: 1,767
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

Post #1521
Posted 06/13/2006 2:27:33 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:58:13 AM
Posts: 4,379, Visits: 4,421
Oh, I follow what you are saying.  Thanks for pointing this out...we will get it fixed.
Post #1525
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 1:24pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.