Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
a_f:a:display_document [2022/09/01 01:23] – removed - external edit (Unknown date) 127.0.0.1a_f:a:display_document [2025/06/12 03:59] (current) – Change to AwareIM aware_support3
Line 1: Line 1:
 +{{tag>Index Action Action_List Process Documents Files}}
 +====== DISPLAY DOCUMENT ======
 +
 +This action displays the specified document on the screen. The action has two variations:
 +
 +  * ''DISPLAY DOCUMENT'' AttributeIdentifier()[ ''USING'' StringLiteral()] [ ''MERGE INTO ONE'' ][ ''AS XLS'' ][ ''IN ZOHO'' ][ ''IN OO'' ][ ''NEW WINDOW'' ][ ''MERGE WITH'' AttributeIdentifier()]
 +
 +The action written in this format displays the contents of the attribute of the specified business object, provided that this attribute is of the Document type. Whatever document is stored in the attribute will be displayed – no document processing is performed. For example,
 +
 +<code aim>DISPLAY DOCUMENT Statement.StatementDocument </code>
 +
 +  * ''DISPLAY DOCUMENT'' (Id() | StringLiteral()) [ ''AS MESSAGE'' ][ ''USING'' StringLiteral()] [ ''MERGE INTO ONE'' ] [ ''NEW WINDOW'' ][ ''MERGE WITH'' AttributeIdentifier()][ ''DELETE AFTER'' INTEGER_LITERAL]
 +
 +where Id() or StringLiteral() is the name of the document template to be displayed. Before the document template is displayed the action calculates and fills in attribute values used inside tags in the template (see also the “[[docs:2000_concepts:0900_prod_feats:0200_working_with_docs_reports:0200_doc_gen|Document Generation]]” section). 
 +
 +Consider the following rules:
 +
 +<code aim>FIND Person WHERE Person.Name='John Smith'
 +DISPLAY DOCUMENT AccountOpeningLetter </code>
 +
 +where AccountOpeningLetter is the name of the document template. If this template has the following line: 
 +
 +<code> Dear <<Person.Name>>,  </code>
 +
 +it will be replaced with the line 
 +
 +<code> Dear John Smith </code>
 +
 +when the template is displayed.
 +
 +<callout type="primary" icon="true" title="note"> If ''AS MESSAGE'' keyword is specified the text of the document will be displayed in a pop-up message box. This option is only suitable for text or HTML document templates.</callout>
 +
 +
 +<callout type="primary" icon="true" title="note"> You can specify a query in ''USING'' keyword. AwareIM will use the query as the data source for the document. AwareIM will produce as many documents as there are instances returned by the query. If ''MERGE INTO ONE'' keyword is not used AwareIM will display all instances on screen (the user will have to click on an icon next to each entry to see the document). If ''MERGE INTO ONE'' keyword is specified AwareIM will automatically merge all documents into one document and show it to the user immediately.</callout>
 +
 +
 +<callout type="primary" icon="true" title="note"> ''AS XLS'' keyword can be used to display reports in the XLS format rather than the default PDF format</callout>
 +
 +<callout type="primary" icon="true" title="note"> ''NEW WINDOW'' keyword can be used to display documents in a separate browser window</callout>
 +
 +<callout type="primary" icon="true" title="note"> ''MERGE WITH'' keyword can be used to merge the displayed document with any other document stored in some object in an attribute of the ''DOCUMENT'' type (at the moment this is only supported for PDF documents), for example
 +
 +
 +<code aim>DISPLAY DOCUMENT AccountOpeningLetter MERGE WITH SystemSettings.TermsAndConditionsDoc </code></callout>
 +
 +<callout type="primary" icon="true" title="note"> ''DELETE AFTER'' keyword can be used to specify a number of seconds after which the generated document will be deleted on the server for security reasons. If not specified, the document will be deleted when the user logs out. For example to delete the document after 15 seconds use the following:
 +
 +<code aim>DISPLAY DOCUMENT AccountOpeningLetter DELETE AFTER 15 </code></callout>
 +