Declaring and Calling the Generate_Triggers Function

Absence Management trigger-generation logic is stored in the FUNCLIB_GP.TRGR_FUNCTIONS FieldFormula PeopleCode. In order for a record to generate triggers, the GENERATE_TRIGGERS function stored there must be declared and called from the record in SavePostChange PeopleCode. We describe this function in detail with supporting examples in the documentation on defining retroactive, segmentation, and iterative triggers. In this topic, we summarize only the main setup steps.

Using Generate_Triggers PeopleCode

To declare and call the Generate_Triggers function:

  1. Declare the function that generates triggers:

    Declare Function Generate_Triggers PeopleCode 
    FUNCLIB_GP.TRGR_FUNCTIONS FieldFormula;
  2. Declare a local date variable as:

    Local date &L_DT;
  3. Invoke the function as:

    Generate_Triggers(EMPLID, &L_DT);

The function Generate_Triggers is defined in FUNCLIB_GP.TRGR_FUNCTIONS.FieldFormula and needs two parameters when it is invoked. These parameters are:

  • &P_EMPLID

    Identifies the EMPLID for which a trigger should be generated. Use field EMPLID for &P_EMPLID.

  • &P_FIXED_DT

    Holds the value of the trigger effective date for records with a Trigger Effdt Type of Fixed Date. It is ignored for records with a Trigger Effdt Type of Effdt or Begin-End Date. Use &L_DT for &P_FIXED_DT.

The variable &L_DT needs to be assigned a value only in the case of Fixed Date type triggers.