CodeCharge Studio

DeleteAllowed Run-Time Property (ASP)

Applies to

Record Form, EditableGrid Form






object.DeleteAllowed [= value]


This property contains a Boolean value that determines if the form has record delete operation enabled. This affects Delete button displaying and database delete operations.

If security is configured for the site and the form's Restricted property has been set to "Yes", the default delete operation permission depends on current user's group permissions. If Restricted property is set to “No” then DeleteAllowed property is set to True unless modified in Before Delete event event.

This property may be set according to a custom permissions checking scheme to enable or disable delete record operation. The delete button is hidden only if the value is set before the form's Before Show event (for instance in the parent component). Requested delete operation may be cancelled in Before Delete event if the DeleteAllowed property is set to false.


The following example checks if the order record that is requested to be removed belongs to the currently logged in user. If it does, the operation is carried out. Otherwise, the delete database operation is not performed.
The example assumes DeleteOrder form exists and user_id hidden field to store the owner's identifier is inserted. This code may be inserted into Before Delete event.

If DeleteOrder.user_id.Value = CCGetUserID() Then
  DeleteOrder.DeleteAllowed = True
  DeleteOrder.DeleteAllowed = False
End If

See also

Before Delete Event
ReadAllowed Property
InsertAllowed Property
UpdateAllowed Property

On-line, printable versions and updates