× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If I understand this correctly, when the trigger program writes to the
file simply but in a Create Program name of the trigger program and then
in After Insert action in the trigger program check the Create program
name first and if it is the trigger program then skip the processing.

-----Original Message-----
From: mapics-l-bounces@xxxxxxxxxxxx
[mailto:mapics-l-bounces@xxxxxxxxxxxx] On Behalf Of Patrick Shrader
Sent: Thursday, February 09, 2006 4: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

_______________________________________________
This is the MAPICS ERP System Discussion (MAPICS-L) mailing list
To post a message email: MAPICS-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mapics-l
or email: MAPICS-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mapics-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.