Domino Code Fragment

Code Name*
Update two fields on the main document from two fields entered on this latest response document.?
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.12.161.161
Description*
A button macro on the Main Document to compose a new response has the following formula:
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
A button macro on the Main Document to compose a new response has the following formula:

@Environment("MDVar"; MDField); Load Environment Variable with current value
@Command([Compose]; ""; "Response") Compose Response Document

The field on the Response Document to be copied back has the following Input Translation formula:

@If(RField != ""; @Do(@Environment("MDVar"; RField); RField); RField)
Loads Environment Variable with value from
Response Document. You must set the field
to itself in both conditions of the @If or you lose
the original value entered.

A button on the Response Document to Save the response and refresh the Main Document goes
as follows:

@SetField("Save1"; "1"); Sets a hidden field value
@Command([FileSave]); Saves the Response Document
@Command([FileCloseWindow]); Closes the Response Document
@Command([EditDocument]; "1"); Puts the Main Doc in Edit Mode
@Command([ViewRefreshFields]); Recalcs the computed fields
@Command([FileSave]) Saves the Main Document

A hidden field on the Response Document has the following formula to prevent users from saving
the document without pressing thte Save button.

@If(@IsDocBeingSaved; @If(Save1 = "0";
@Failure("Please press the Save Button to save this document"); @Success); @Success)
The default value is "0" and since it can only be
set to "1" by the Save button, a Failure will occur
if an attempt to save the document without the
button occurs.

Finally, on the Main Document, the field to be loaded from the Response is a Computed field with
the following formula.

@If(MDField != @Environment("MDVar"); @Environment("MDVar"); MDField)
If the field is different from the Environment
variable, set the field to the Environment
variable, else set the field to itself.