+ Reply to Thread
Results 1 to 3 of 3

Thread: Trigger program

  1. #1
    Guest.Visitor Guest

    Default Trigger program

    Hi there! I encountered a situation where I need to make changes to the record in the trigger program before it is being written to a physical file. For example: If my file has 4 fields in it and user is allowed to input data into 3 fields , my trigger program on the file being written to should fill in the data to the 4th field and then allow the insert operation to complete.The result should be that all 4 fields filled in with values when we query the data from the file.. Is it possible? Let me know how to do it... Thanks, Anil

  2. #2
    D.Handy Guest

    Default Trigger program

    Anil, Is it possible? Let me know how to do it... It became possible in V3R2 and V3R7 when they added the ALWREPCHG(*YES) option. The default is *NO for backward compatability, and to keep you from inadvertently changing the record. The program must trigger on the *BEFORE event (by the time *AFTER comes, it is too late). And it must specify ALWREPCHG(*YES) to "allow repeating change", i.e., allow the trigger to change the record buffer too. Then just change the buffer image in the input parameter. Do not do attempt to use disk I/O (to this record). Any buffer changes you make will be reflected when the data is written to the disk. Doug

  3. #3
    Guest.Visitor Guest

    Default Trigger program

    I have posted the trigger program template our group uses on http://www.mvmills.com/is Feel free to copy it and modify for your purposes. Let me know if I can help further.

+ Reply to Thread

Similar Threads

  1. DDM trigger originating program
    By kimbary in forum CL
    Replies: 0
    Last Post: 06-15-2004, 09:04 AM
  2. Trigger Program Buffer.
    By John Polucci in forum General
    Replies: 1
    Last Post: 04-19-2004, 09:36 AM
  3. Trigger Program Example
    By Guest.Visitor in forum RPG
    Replies: 4
    Last Post: 09-24-2003, 01:22 AM
  4. Replies: 0
    Last Post: 12-12-2001, 08:20 AM
  5. Trigger Program
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 02-04-2000, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts