Currently for auditing purposes inside triggers, we go through a list of auditable fields and manually check their value against the old buffer, then add them to a chr(1) delimited list to create the audit records.
I'm trying to come up with a solution the uses the BUFFER-COMPARE statement to generate a list of the fields that have changed and then use buffer handles to store the different values. The problem is of course, that as soon as you use buffer handles, you get the same (new) result from the new buffer and the old buffer.
Does anyone have a solution to this problem?
Code snippet:
I'm trying to come up with a solution the uses the BUFFER-COMPARE statement to generate a list of the fields that have changed and then use buffer handles to store the different values. The problem is of course, that as soon as you use buffer handles, you get the same (new) result from the new buffer and the old buffer.
Does anyone have a solution to this problem?
Code snippet:
Code:
DO lvi = 1 TO NUM-ENTRIES(lvDiffs):
ASSIGN
lvLabels = lvLabels +
(IF lvLabels EQ "" THEN "" ELSE CHR(1)) +
ENTRY(lvi,lvDiffs)
lvOldValues = lvOldValues +
(IF lvOldValues EQ "" THEN "" ELSE CHR(1)) +
STRING(lvOldHandle:BUFFER-FIELD(ENTRY(lvi,lvDiffs)):BUFFER-VALUE)
lvNewValues = lvNewValues +
(IF lvNewValues EQ "" THEN "" ELSE CHR(1)) +
STRING(lvNewHandle:BUFFER-FIELD(ENTRY(lvi,lvDiffs)):BUFFER-VALUE).
END.