Domino Code Fragment

Code Name*
Deleting Main Documents and Their Responses
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.137.170.183
Description*
If you would like all response documents to be deleted from a database when the main document is marked for deletion, follow this tip:
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Use a unique ID number for your main documents, call it something like UID. Use the following formula for the creation of Unique ID's:

TD := @Text(@Today);
TT := @Text(@Time(@Now));
DateString := @Left(TD; 2) + @Middle(TD; 3; 2) + @Right(TD; 2) + @Left(TT; 2) + @Middle(TT; 3; 2) + @Middle(TT; 6; 2);
@Left(@UserName; 1) + @Middle(@UserName; " "; 1) + DateString

Next, enable inheritance in the response documents and allow a field (same field name for each document) to inherit the UID of the parent. In your delete button off of the main document you would set an environment variable to the parents UID, then run a filer macro to run on all documents in the database with a SELECT statement set to the environment variable that holds the unique ID. This macro should then mark all documents that match the UID for deletion.