Sequence of Events: Deletion of a Data Record
The figure below illustrates the sequence of events raised during the deletion of a data record.
A data record is deleted when a user deletes the record on the user interface, the
deletion request is sent through the Web Service API, or the Delete()
method of a data view is invoked in code. As a result of the deletion, the data record gets
the Deleted status if it already exists in the database, or the
InsertedDeleted status if the record has just been inserted into the
PXCache object and deletion from the database is not required. The data
record is later available through the Deleted and
Dirty collections of the PXCache object.
If the deletion has been initiated by a user on the UI or through the web services API, the following field events are raised for each key data field before any other events are raised:
FieldUpdating
FieldUpdated
Next, regardless of how the deletion was initiated, data record events are raised as follows:
RowDeleting
is raised. At this point, the developer can still stop the deletion by throwing a PXException instance. In thee
variable representing event data,e.Row
holds the data record being deleted.- If
e.Cancel
does not equaltrue
:RowDeleted
is raised, ande.Row
still holds the data record.RowSelected
is raised, ande.Row
equalsNULL
.