Domino Code Fragment

Code Name*
Field Synchronization
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.144.154.208
Description*
When trying to set one field equal to another when the document is loaded into memory, for example, if you want to set FieldX equal to FieldY so that if FieldY is changed, and they will be equal again when the document is reloaded, follow this tip:
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
At the top of the form make a hidden computed field (Init). The key here is not to have a defined field on the form SaveY

FIELD SaveY := @If(@IsDocBeingLoaded; Y; SaveY);

Then at the bottom of the form put your other hidden computed field (Z)

FIELD SaveY := SaveY;
@If(SaveY = Y; Z; @IsDocBeingSaved; @Do(@SetField("SaveY"; Y); @Today); Z)