Trigger Program not returning modified

5 pts.
Tags:
iSeries v7r1
TRIGGER
I have an "UPDATE *AFTER ALWREPCHG(*YES) trigger, that meant to validate if the user is authorized to modify a particular field. if not authorized, I replace the "after" value with the "before" value and end the trigger program .... however, the file is being updated with the original "after" value. Why is the trigger program not returning the "after" buffer that I have modified?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    Are you trying to change the trigger definition of the PF on the fly?
    If this is to allow authorization to the update why not put in in the program. Just retrieve the userid and validate it against your allowable userid database. Can you post the code to review it?
    129,510 pointsBadges:
    report
  • philpl1jb

    *AFTER means that the trigger program is called after the update has occurred. But I don't think your plan would work even if you changed it to *BEFORE

    .. there was something about using before and throwing an error to stop the update.

    54,090 pointsBadges:
    report
  • BigKat
    *BEFORE ALWREPCHG(*YES) is when you need to run your trigger.  You need to change the data before it is written to the database.

    @Philpl1jb - you can always throw an error and prevent an update, or you can "fix" the update and allow it IF you ALWREPCHG(*YES)
    9,420 pointsBadges:
    report
  • philpl1jb

    Thanks BigKat

    .. either I had some really, really old info ( and that makes sense since I'm really, really old)

    .. or it was a response to a very different question .. ( and I'm hard of hearing)

    54,090 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: