|
Patrick, The trigger will fire on ANY insert. You could submit a job to insert the additional 5 records so they are done outside of the original trigger processing. You will need to tag them in some way to identify to your trigger program that they are the additional insert records and not try to process them. Regards, -Greg Gregory Novak Manager North American Technical Services Momentum Utilities Pty Ltd (630) 985-1736 gnovak@xxxxxxxxxx www.jacana.com Making Information Work for your Business www.intuator.com -----Original Message----- From: Patrick Shrader [mailto:pshrader@xxxxxxxx] Sent: Thursday, February 09, 2006 3:44 PM To: MAPICS ERP System Discussion Subject: [MAPICS-L] Trigger programming question What's the trick to keep a trigger program from acting on its own results? I have an insert trigger applied to the customer item cross reference file (to update all the like accounts with the same info), but when I change the customer number and insert a record, the trigger fires again and wants to check the new record's validity. I realize that it is calling itself recursively, but how can I stop this? I've created the trigger with this command: ADDPFTRG FILE(AMFLIBP/MBBIREP) TRGTIME(*AFTER) TRGEVENT(*INSERT) PGM(PATL IB/TRGMBBIREP) RPLTRG(*YES) ALWREPCHG(*YES) And with ALWREPCHG(*NO) as well. I want the system to first insert record keyed by the user, then kick off my changes adding another 5 records to the MBBIREP file. However, that's when I get the recursive call. I want the trigger to only run when the original entry is made, not the entries created by the trigger file. I'm probably overlooking something simple, but would appreciate any hints you might have. Thanks, Patrick
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.