Data-Driven Events
|
Method |
Parameter |
Return value |
Comment |
|---|---|---|---|
|
some_event(dtp_record, event) |
|
bool |
|
Example
-
To block saving/deleting you can create a pre-save/delete event that returns False when required. In this example we prevent the deletion of a record that has its “active” flag set:
Python
def prevent_deletion_event(dtp_record, event):
if dtp_record.active.get_value():
return False
return True
-
We then create an event record for the table the record is in, set the event type to “pre-delete”, function type to “python”, insert the path to this event function and enable the “active” flag of the event