Problem in the event Before record is updated



I need to modify the MCU of the table F060116 in each insert or update of this table.
So, I created a function that can recover the MCU from other fields.
I called this function in the trigger of this table to modify the value of TK MCU with the new recovered.
This function is functional in the event Before record is inserted and not functional in before record is updated.
Do you have please any idea about this problem knowing that normally the modification of the MCU is only done for the modification of one of the 4 fields and I could not know how to recover the values before the update to make the comparison with the news values ​​to do the test.
In advance thank you.

Kim Schmidt

Active Member
When you're updating the record, you could add a fetch single to F060116 on the employee's AN8 to get the old values of your four fields, then compare them with the new values. If any have changed, then call your function. Another way would be to use a database trigger. Although your signature doesn't say what platform or database you're using, most databases make both the old and new values available for testing.


Thank you,
I do the fetch single but it doesn't work.
also the problem is that when the function return a new MCU, it doesn't updated.
in the event before record is updated I do a call without any condition to this function with the AN8 and normally it return a new value of MCU
i affected this value to the TK MCU but this filed isn't updated.

Version JDE 9.2