ComposeWithReference @Command (Formula Language)
Creates a new document filling in the Body rich text field with values based on the current document.
Syntax
@Command([ComposeWithReference]; server : database ; form ; flags )
Parameters
server : database
Text list. The name of the server and database where you want to create the document. Null for server means the local Domino® or Notes® directory; must be null on the Web. Null for server and database means the current database. The new document must be in the same database as the current document if you want the new document to be a response document.
form
Text. The name of the form you want to use when creating the new document. This form must contain a rich text or rich text lite field named "Body." This form must be a response form if you want the new document to be a response document.
flags
Number. Optional. One or more of the following reference attributes. Combine attributes by adding them. Defaults to flags 3 plus 4. You must supply this parameter in Web applications.
- 0 -- includes Body in a collapsible section (flags 3 plus 4, the default). Cannot be combined with other flags. Does not work on Web.
- 1 -- Includes a reference to the main document. Cannot be combined with other flags. Does not work on Web.
- 2 -- Includes no history. Cannot be combined with other flags.
- 3 -- Includes the Body of the main document. Can be combined with the flags that follow.
- 4 -- Puts the Body of the main document in a collapsible section. Does not work on Web.
- 8 -- Includes Body as an Internet-style copy of the main document, with a "So-and-so wrote on ..." header and each line prefixed by a greater-than sign. Requires flag value 2. Implicitly applies flag 16. Does not work on Web.
- 16 -- Removes attachments, images, and other large objects from the reference copy, replacing them (except on the Web) with text statements in brackets.
- 32 -- Where the database containing the current document has a $ForwardSep subform (as exists in the Release 6 mail template), prefixes the reference copy with a forward separator. Does not work on Web.
Usage
A document must be open or selected in a view to use this command.
The new document is a response to the current document if the two documents are in the same database and the specified form is a response form.
If this command is used in a view action, the form formula of the view will override the form specified in the @command. To avoid this problem add the following line to the form formula of the view:
@If(@IsNewDoc; @Return(Form); "")
Examples
- This example, when used in an action button in a database containing
a $ForwardSep subform, composes a forwarded mail memo referencing
the main document.
@Command([ComposeWithReference]; @MailDbName; "Memo"; 3 + 32)
- This example, which could be a form or view action, creates a
response document based on the Reply form containing a link to the
main document.
@Command([ComposeWithReference]; ""; "Reply"; 1)
- This example creates a response document with no copy of or reference
to the main document.
@Command([ComposeWithReference]; ""; "Reply"; 2)
- This example creates a response document containing a copy of
the main document.
@Command([ComposeWithReference]; ""; "Reply"; 3)
- These three examples are equivalent. Each creates a response document
containing a copy of the main document in a collapsible section.
@Command([ComposeWithReference]; ""; "Reply"; 3 + 4) @Command([ComposeWithReference]; ""; "Reply"; 0) @Command([ComposeWithReference]; ""; "Reply")
- This example creates a response document containing a copy of
the main document in Internet style.
@Command([ComposeWithReference]; ""; "Reply"; 3 + 8)
- This example creates a response document containing a copy of
the main document in a collapsible section in Internet style.
@Command([ComposeWithReference]; ""; "Reply"; 3 + 4 + 8)
- This example creates a response document containing a copy of
the main document with attachments stripped.
@Command([ComposeWithReference]; ""; "Reply"; 3 + 16)
- This example creates a response document containing a copy of
the main document in a collapsible section with attachments stripped.
@Command([ComposeWithReference]; ""; "Reply"; 3 + 4 + 16)
- This example composes a forwarded mail memo in the current database
(which much contain a form named "Memo"). All attachments are stripped
before the main document is copied to the new memo.
@Command([ComposeWithReference]; ""; "Memo"; 3 + 16 + 32)
- This example composes a forwarded mail memo in the current database.
The new document contains an Internet-style quoted copy of the reference
document. All attachments, images and other large objects are stripped
before the main document is copied to the new one.
@Command([ComposeWithReference]; ""; "Memo"; 3 + 8 + 32)
- This example, when triggered from an action button on a form,
checks if the current document has been saved. If not, it saves it,
then opens the "responseDoc" response document, including the body
of the main document in a collapsible section.
@If(@IsNewDoc;@Do(@Command([FileSave]); ""); @Command([ComposeWithReference];"";"responseDoc")