Domino Code Fragment

Code Name*
Tracking who changed a critical field
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.119.118.99
Description*
Add an audit trail of the modifications made to a critical field:- In this case the field is named "PRIORITY"
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
1.Create a duplicate "PRIORITY" field (named "PRIORITYDelta") that is hidden and has in its input translation formula a statement to store the contents of the PRIORITY field. This will retain the contents of the priority field before editing in a current session.2.Create a multi-value field ("Updatesto") with a formula that compares PRIORITY to PRIORITYDelta when the document is being saved and when the condition is right (i.e. PRIORITY != PRIORITYDelta) attaches the new save information to the field:



feed := @Name([CN]; @V3UserName) + " on " + @Text(@Date(@Now)) + " at " + @Text(@Time(@Now)) + " " + PRIORITY;
FIELD Updatesto := @If(@IsDocBeingSaved & PRIORITY != PRIORITYDelta ; Updatesto : feed; Updatesto);
Updatesto