Inverso
Member
Hi Guys,
I'm currently writing some table event rules to create an audit trail for several of our tables. I've put some code into the "before update" event that fetches old values for a record being updated using a handle & compares these to the TK values. Where they are different, it creates a record in the audit table. However, I've spotted that a number of fields that are not being changed are showing up as being updated to blank. I'm pretty certain that my code works, so the only reason I can see (and my limitted knowledge of C++ debugging confirms this) is that the new values are null if they are not updated. I could just put in code to check if the new value is blank and ignore it if it is, but I would like to allow fields to be updated to null if the code tries to do this, but with it still being auditted. Another idea is to create a work file & put the old record values into there before the update, then compare them after the update to see the fields that have changed - though that would slow things down quite a bit with all the IO going on.
Has anyone come across this problem before / do you know if I am right about the null values / any ideas how to get round it?
Many thanks in advance,
John
[system info]
JDE Version - OneWorld B733 SP20
Fat Client - Win XP Pro
Thin Client - Citrix Metaframe XP on Win2K Server
UBE Servers - Win2K Server
Database - Oracle 10g on Win2K3 Server
[/system info]
I'm currently writing some table event rules to create an audit trail for several of our tables. I've put some code into the "before update" event that fetches old values for a record being updated using a handle & compares these to the TK values. Where they are different, it creates a record in the audit table. However, I've spotted that a number of fields that are not being changed are showing up as being updated to blank. I'm pretty certain that my code works, so the only reason I can see (and my limitted knowledge of C++ debugging confirms this) is that the new values are null if they are not updated. I could just put in code to check if the new value is blank and ignore it if it is, but I would like to allow fields to be updated to null if the code tries to do this, but with it still being auditted. Another idea is to create a work file & put the old record values into there before the update, then compare them after the update to see the fields that have changed - though that would slow things down quite a bit with all the IO going on.
Has anyone come across this problem before / do you know if I am right about the null values / any ideas how to get round it?
Many thanks in advance,
John
[system info]
JDE Version - OneWorld B733 SP20
Fat Client - Win XP Pro
Thin Client - Citrix Metaframe XP on Win2K Server
UBE Servers - Win2K Server
Database - Oracle 10g on Win2K3 Server
[/system info]