- Print
- PDF
The Attachments functionality in Lasernet FO Connector enables users to pick up files linked to specific records within Dynamics 365 Finance and Operations and attach them to reports sent with Lasernet.
For more information on the topic, watch our feature video.
Attachment Settings
When using attachments, you can customize the setup criteria to define how attachments should be used for a report.
Attachment setups for all reports can be found in Lasernet > Setup > Overview > Attachments.
Attachment setups for a specific report can be found in Lasernet > Common > Reports > Setup > Attachments.
Attachments can be used for various reports; for instance, terms of delivery and terms of sales can be attached to the Sales Confirmation report.
The following example illustrates how an attachment can be set up:
Skip Generic Attachments
Use the Skip generic attachments toggle button to define whether generic attachments are used for the current report (toggle to Yes) or they are not (toggle to No).
Report Attachments
Attachment From
From attachments: will add the attachments (DocuRef/DocuValue) from the table specified in Attachment reference table.
From archive: useful when needing to add existing documents from the Archive.
Reserved: used with context methods and does not require/respect any setup for the attachments as this is managed through the context method itself.
Attach
All: will (for the table specified in Attachment reference table only) add all attachments or all documents from the Archive that meet the specified criteria (Restriction, Type, and Condition).
Last: will (for the table specified in Attachment reference table only) add the last attachments or last document from the Archive that meets the specified criteria (Restriction, Type, and Condition).
First: will (for the table specified in Attachment reference table only) add the first attachments or first document from the Archive that meets the specified criteria (Restriction, Type, and Condition).
Command | Description |
---|---|
Attachment reference table | This table is used as a reference for attached documents that have to be printed with the report. Use this field to define a related source for a report. |
Restriction | Internal: attachments are restricted to internal use only. External: attachments are restricted to external use only. |
Type | Identification of document type. Use this field to define a document type: Image, File, Note, URL. |
To add custom fields. | |
Document type | Description of current document type. Use this field to add a description of the document type defined in the Type field, which is relevant for using overlays: All types, Original, Copy, Pro forma, Pro forma copy. |
Add attached document if delivery destination is Screen or Email. Not applicable for the Lasernet Screen option. | |
Printer | Add attached document if delivery destination is Print. |
Fax | Add attached document if delivery destination is Fax. |
Custom port | Add attached document if delivery destination is Custom. |
Description | Use this field to provide a meaningful description of an attachment. |
Deliver as Base64 | Use this field if you want to embed the document into the XML file as Base64. |
Condition
A condition can be used to further control when an attachment should be picked up.
None - No condition.
Query - Can use query filters and ranges. Will process this attachment setup if the query filters or ranges are met and will skip this attachment setup if the query filters or ranges are not met.
Code - Can use an expression. Will process this attachment setup if the code condition expression is True or 1 and skip this attachment setup if the code condition expression is False or 0.
Attachments via URL vs. Base64
The Lasernet server handles attachments. There are two ways in which the Lasernet server processes attachments: an attachment can be embedded into the XML file, or it can be taken from a URL.
The following is an example of an XML file available from a URL in the Azure storage:
This, instead, is an example of an embedded XML file:
How to Set Up Attachments for a Query Report - Example
Identify the table to which you will be adding the attachment.
Navigate to the form in Dynamics 365 FO where the attachment is found. In this example, we want to add attachments to the Sales Confirmation journal so we will navigate to Sales and Marketing > Sales Orders > Order Confirmation > Sales Order Confirmations.
Select the Attachment icon on the Menu bar.
On the Attachments form that opens, right-click anywhere on the form to bring up the Form Information menu. Select Form Name: DocuView.
A Form information form will open. Scroll down to the Query Statement field in the Administration FastTab. Copy the value for RefTableId. This is the reference table ID.
You will need to identify the name of the table from the ID. For more information, reference our article How Do I Find a Table Name Using the Table ID for Docuref and Attachments? In this example, the reference table ID corresponds to the CustConfirmJour table:
Navigate to the report in Lasernet > Common > Reports.
Select the report query from the list and then select Query Wizard from the Action pane.
In the Query wizard, add the reference table identified in the previous steps.
Click Finish on the Query wizard and then select Attachments from the Action pane.
Add a new record and select the Attachment reference table. This is the reference table we have identified and added through the Query wizard. In our example, table CustConfirmJour.
Select From attachments for the Attachment from field. This will add the attachments from the table specified in Attachment reference table.
Select All for the Attach field to add all attachments that meet the specified criteria (Restriction, Type, and Condition).
Specify the Restriction, Type, Document Type, and enable PDF, Printer, Fax, and Custom Port as shown below. We will leave Deliver as Base64 disabled.
Close the Attachments form, navigate to Sales and Marketing > Sales Orders > Order Confirmation > Sales Order Confirmations, and identify your sales order confirmation with attachments.
Note
This example assumes you have already added the needed attachments in Dynamics 365 Finance and Operations. If you have not already added the attachments, review our Document Handling (https://formpipe.document360.io/docs/document-handling) documentation.
Send the report to a Lasernet destination other than Lasernet Screen.
If archiving is enabled, navigate to Lasernet > Common > Archive and Preview the XML. Notice that the XML contains attachment details in the JobInfo section. This information is processed by Lasernet to retrieve the attachments.
The report is sent along with its attachment.