5 pts.
 Advanced Trigger question for *insert *before to allow update of field value
I need to update a field in a record being written prior to it being written. I want to do it with a trigger because many programs write and update this file. I have tried several things and the closest I have gotten is to do a *before *insert where I can see the values of the fields in the after image. I changed the value of the field I needed to change and it shows I changed it but the value doesn't return back to the program that caused the trigger so it doesn't write the modified value to the record.

Software/Hardware used:
ASKED: November 28, 2007  7:02 PM
UPDATED: August 4, 2010  2:49 PM

Answer Wiki:
The *before *insert trigger program runs after the application program has written the record and before database actually records the new records. The changes made by the trigger are not returned to the application (the application has done a WRITE, not a READ), but are written to the database (assuming ALWREPCHG is *YES that is). Bruce Vining Bruce Vining Services
Last Wiki Answer Submitted:  November 29, 2007  1:46 pm  by  bvining   6,055 pts.
All Answer Wiki Contributors:  bvining   6,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hi Bruce

Based on your answer, I have an additional question. I have a trigger program that decrypts a field after a read operation occurs from the application program. I would like to be able to return the value of this decrypted field to the application program.
Is there a way to do this ?

Thanks,
Nick

 410 pts.