onbeforedelete |
This event is fired before the business object(s) is deleted.
Syntax
| DesignTime | This is a design-time property and can be set through the property sheet of the control. |
Event Information
| To invoke | Click the Delete button in the control bar to fire this event. |
| Default Action | Initiates any events associated with this event. |
| Named Script | OnBeforeDelete |
Event Object Properties
| Property | Description |
|---|---|
| returnValue | Boolean that denotes whether the deletion operation should be continued or not. To cancel the event, user can set the value of this property to false. |
| true | Default. Deletion operation should be continued. |
| false | Deletion operation should not be continued. |
| srcElement | Reference to the Delete button. |
| showConfirmMessage | Boolean that denotes whether the confirmation message should display on deleting business objects. |
| true | Default. Confirmation message should be displayed. |
| false | Confirmation message should not be displayed. |
An event handler can access the event object and its properties through the eventObject available as a parameter on the handler.
Example
The code below sets the onbeforedelete handler's returnValue to false when its previous transaction had ended in a SOAP Fault.
function beforeDeleteHandler(eventObject)
{
if (EmployeesModel.soapFaultOccured)
{
alert("Cannot proceed with deletion. Previous transaction had failed!");
eventObject.returnValue = false;
}
}