StrataFrame Forum

Deleting Records on SF Maintenance Form

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

By Tim Dol - 10/23/2007

Right now when you use the standard SF Maintenance Form, the delete functionality removes the record from the database upon confirmation.

I need the ability to mark the record for deletion, plus change when the delete button is enabled. I have no problem enabling/disabling the button based on the editing state but I can't seem to find a way to mark the record for deletion and use the save to commit the changes. Is there a way to do this without creating a new button and handling the delete separately? 

Thanks,

Tim

By Ralph Rutschmann - 10/23/2007

Hello Tim,

from the help file:

-------------------------------------
DeleteCurrentRow() - Only Mark As Deleted Sample [VisualBasic]
''' 
''' This sample shows how to mark the current row as deleted
''' in a business object.
'''
'''
Private Sub DeleteCurrentRowSample()
'-- Mark the current row as deleted
Customers.DeleteCurrentRow(True)
'-- At this point the record has only been marked as deleted.
' The CurrentRow will be moved to the next record that is not
' deleted unless the ShowDeletedRecords property is turned
' on within the business object. Now save the changes to the
' server.
Customers.Save()
End Sub
The important part is: 'DeleteCurrentRow(true)'
HTH,
Ralph
 
By Tim Dol - 10/24/2007

Yes, but you don't have the option to specify this value with the delete button in the standard maintenance form toolstrip. The delete action physically removes the record from the database once you have confirmed the action. I can certainly replace the delete button with my own button and mark the record as deleted but I am looking for something, perhaps in the 'BeforeDelete' event, to set a flag to mark the record for deletion so I can retain the standard SF functionality.

Tim

By Trent L. Taylor - 10/24/2007

Tim,

At present the MaintenanceFormToolstrip does not have that ability.  You could always hide the Delete button and then create your own in this scenario.  But this is probably a good one for the enhancement list. Smile