Customizing
Version 27 Version 26 39.5.25 39.5.23 39.5.22 39.5.21 39.5.20 39.5.19 39.5.18 39.5.17 German English
Version 27 Version 26 39.5.25 39.5.23 39.5.22 39.5.21 39.5.20 39.5.19 39.5.18 39.5.17 German English

Python Events

Die nachfolgenden Inhalte sind nur in englischer Sprache verfügbar.

Data-Driven Events

Method

 Parameter 

Return value

Comment

some_event(dtp_record, event)

dtp_record: the record triggering the event

event: the event itself

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