Logical delete triggers

Logical delete triggers can be used to write the business logic associated with the delete operation on the table. The default delete trigger x/xxxxtdel.p automatically executes the logical delete triggers x/xxxxldel.p when available. The default and logical delete triggers are executed in a single transaction such that failure at any point will revert the entire delete operation. When the delete trigger is first generated, the trigger file will contain a procedure stub p-delete as shown below:

/* ------------------------ Copyright Javra Software ---------------------------

File : C/Custldel.p
Description : Delete trigger for Customer
Created : 16/12/14 Javra Software

Date Author Version Description

16/12/14 javra 1.00 Created
------------------------------------------------------------------------------*/

{x/xxxxldel.i}
{x/xxxxpvar.i} /*- default variables -*/

procedure p-delete :
/*------------------------------------------------------------------------------
Purpose:
Notes:
------------------------------------------------------------------------------*/

def var v-CustNumhdl as handle no-undo.

assign v-CustNumhdl = p-bufferhdl:buffer-field("CustNum")
.

end procedure. /* p-delete */

The p-delete procedure is executed whenever a record is deleted from the table. One of the included files contained in the logical delete trigger file is x/xxxxldel.i. This file contains two input parameters which hold the values for current buffer handle of the table (record being deleted) and the handle of the procedure which starts the transaction. The input parameters are shown in the code snippet below:

def input param p-bufferhdl as handle no-undo. /* handle of the trigger buffer */
def input param p-xproc as handle no-undo. /* handle of the program with the transaction */

results matching ""

    No results matching ""