OpenNTF.org - Update two fields on the main
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Update two fields on the main document from two fields entered on this latest response document.? 
Rating:
Not Rated Yet 
Contributor:
Andrew Jones 
Category:
Lotus Formula 
Type:
 
Last Modified:
17 Jun 2002 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
A button macro on the Main Document to compose a new response has the following formula: 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.
Usage / Example
 Comments

No documents found

 Add your comment!