Manage Learn to apply best practices and optimize your operations.

How to send a document as a link in a Lotus Notes email

SearchDomino.com Gunasekaran Subramanian explains how to implement Formula language code that will send documents as links within Lotus Notes email.

This Formula code creates the ability to add a document as a link in a Lotus Notes email. It also includes the database name and field values to the subject line.

I've also set up the code so that it won't send the document unless it has been saved. This may cause problems though, because the Lotus Notes user may leave the document unsaved.

The @UpdateFormulaContext command is used to set the Lotus Notes database name: "document title" in the subject line of the email.

Note: This code won't send an email. It is the user's choice to select the "To" list for the email.

@If(@IsNewDoc; 
@Prompt([Ok]; @DbTitle; 
"New documents cannot be pasted 
as a link. Please save the document 
before using this functionality"); @Do(
@If(@IsUnavailable(docTitle);
 @Prompt([Ok]; @DbTitle;
 "docTitle field does not exist. Please 
contact the Administrator");
                   @Do(
MailSubject :=@DbTitle + " : " + docTitle;
@Command([ComposeWithReference]; 
@MailDbName; "Memo"; 1);
@UpdateFormulaContext;
  @SetField("Subject"; MailSubject)
         )
       )
      )
);

MEMBER FEEDBACK TO THIS TIP

This example could be very useful if used in the right context. The only feedback I have is that deeply nested @If and @Do commands can be very difficult for people to read -- especially when trying to match up the end parenthesis. It is much more straightforward to simply exit the routine using the @Return command (and @Prompt command as well). The simplified code would start like this:

@If( @IsNewDoc; 

@Return( @Prompt([Ok]; @DbTitle; 
"New ... functionality") ); 
@Success );

@If( @IsUnavailable(docTitle); 

  ...


—Doug J.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Gunasekaran Subramainian. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

7 tips in 7 minutes: An introduction to Formula language Formula Language Learning Guide Formula FAQ Formula Language Reference Center

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close