on_before_apply_record

on_before_apply_record(self, delta, params, connection)

domain: server

language: python

class Item class

Description

Write on_before_apply_record event handler when you need to override the standard data saving procedure during the execution of the apply method on the client or server.

On Demo application this event is used to check if Invoice has been paid and if Tracks has been modified outside the Invoice.

Code within Invoice Server module:

def on_before_apply_record(item, delta, params, connection):
    if delta.paid.cur_value:
        item.abort('Operation prohibited. The invoice is paid')

Please check Demo Details\invoice_table\Server module for Tracks.

See also

Server side programming

on_after_apply_record events

on_apply events

Modifying datasets