OpenNTF.org - Updating Parent when Child cha
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:
Updating Parent when Child changes A Notes formula for updating parents when a child 
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
Updating Parent when Child changes A Notes formula for updating parents when a child changes in Notes R3/4. Both parents and responses share a common key, the parent's DocID is stored in each response document in a field called $REF. We can use this common key in a hidden view, call it (Parents by DocID), which contains the following formula in the first sorted column (this column can be hidden):
@Text(@DocumentUniqueID)
Now when someone updates a response document, you can use the following formula in the Save/Close button to quickly open the (Parents by DocID) view to the key that matches the $REF in the response document. Then we can refresh the parent, and/or run a macro on it, and then close the view...

view := (Parents by DocID);
key := @Text($REF);
REM;
REM;
@Command([FileSave]);
@Command([FileCloseWindow]);
@Command([OpenView]; view; key; "1");
@Command([EditDeselectAll]);
@Command([ToolsRunMacro]; "(Set to Filled)");
@Command([ToolsRefreshSelectedDocs]);
@Command([FileCloseWindow]);
By the way, the @DocumentUniqueID function is not documented and is not supported on the Macintosh platform in Notes V3, but it is fully documented and supported in Notes V4.
Usage / Example
 Comments
Posted by Kasper T Mortensen on 06/17/2004 09:52:10 AM@SetDocField
You could also use @SetDocField. This is an excerpt from Designer Help:
This formula, if placed on a button in a response form, changes the Subject of the parent document to "More people are commuting by bicycle." $Ref is a special field on a response document that contains the unique ID of the parent document.
@SetDocField($Ref; "Subject"; "More people are commuting by bicycle")
 Add your comment!