Archiving documents in folders on a file server

Prev Next

You can archive reports in the background in different formats in a folder while posting e.g. a sales invoice.

Steps

  1. In D365 FSCM go to System administration > Setup > dox42 > dox42 parameters.

  2. In the SSRS reports tab select the desired report and then the Archive setup button.

    Dox42 parameters interface showing report setup with highlighted archive setup section.

    SSRS reports tab

  3. Select the New button.

  4. In the Template name column insert the path of the template.

    Dynamics 365 interface showing options to save and create new sales invoice templates.

    Template name

  5. Select the Printer setup button.
    The Print destinations settings page opens.

  6. From the Print medium dropdown select the File server entry.

    Print destination settings for file server, including file name and format options.

    Print destination settings

  7. In the File name text field insert the path of the storage folder and add at the end of the path, how the file should be named.
    Example: C:\dox42Server\templates\TEST\SalesInvoice\Storage\Invoice <%SalesInvoiceLines.InvoiceID%>

  8. From the File format menu select the format to which the file will be saved.

  9. Select OK.

  10. In the Report setup scroll to the right and set up the Archiving enabled and Archiving field name fields as follows:

    1. If Archiving enabled is set to No, then the archiving action is inactive, skipped and not used.

    2. If Archiving enabled is set to Yes, then the report will be unconditionally archived.

    3. If Archiving enabled is set to Depending on the field value (metadata) then D365 FSCM will check the report data source field value specified in the field Archiving field name. For example, when only posted sales invoices should be archived (when the invoice number is not empty), the setup may look like this:

      Example of Archiving enabled is set to Depending on the field value (metadata)

      There is no <% %> required because the value is processed via D365 FSCM according to the report metadata structure and not via dox42. Strictly only one report data source field can be specified as the parameter, any other conditions or expressions are not allowed in the setup. The archiving action is only then executed when the specified data source field has a value, and it is skipped when the data source field value is empty (null value based on the field type).

    4. If Archiving enabled is set to Depending on the field value (template) then D365 FO will check the dox42 template field value specified in the field Archiving field name. Any dox42 template field from the report template can be used to set up an archiving condition. For example, when only invoices with the invoice amount greater than 100 in the company currency should be archived, the setup may look like this:

      Data sources including transaction ID, Excel connection, and D365 reports for invoices.

      <% %> is required because the field placeholder is processed via dox42. Strictly only one template field can be specified as the parameter, any other conditions or expressions are not allowed in the setup. The archiving action is only then executed when the specified template field has a value, and it is skipped when the field value is empty.

      Important

      All template fields are considered as text fields in this mode, so only an empty string is treated as an empty template field value.

  11. Set the Asynchronous archiving field to Yes if you like this archiving setup to be executed asynchronously. This feature can speed up processing for the user in some scenarios (e.g., printing on screen). Otherwise, the archive action is processed sequentially, and the report generation process is waiting for the archiving action to be executed.

    Important

    Asynchronous archiving is only applied when it is activated in dox42 parameters > General > Report Archive.

  12. Select the Save button.

Result

Generated reports will now be archived to the specified path on your file server.