Skip to main content

How to add sales invoices to CustCollectionLetter using Document Handling - Knowledgebase / D365 FO Connector / D365 FO Connector FAQs - Formpipe Support Portal

How to add sales invoices to CustCollectionLetter using Document Handling

Authors list

Lasernet Document Handling makes it possible to store a document in docuref/Attachments. This article will show users how to add sales invoices to CustCollectionLetter using this feature.

Add Document Handling to the Sales Invoice report - configuration

1. On the sales invoice report, click Setup and then Document Handling.

2. Click New and add the reference table where you want the SalesInvoice to be stored in D365FO.

If the document should be sent to the customer afterward, set the Restriction to External.

In Document type - Choose original - so you only store the Original posted and not proformas.

3.  In the Notes panel, create a Description, Note and values used in notes.

4. Print a sales invoice and view the attachments from the CustInvoiceJour.

The document is now stored where required.

Here you can see the Description and the value in notes - showing the invoiceId:

Add CustInvoiceJour table to CustCollectionJour Query wizard

1. From the ribbon, click Query wizard and add the CustInvoiceJour table to CustCollectionJourTmp.

The relations are displayed as follows:

2. Add Docuref to CustInvoiceJour.

Since we are on the line level for the Invoice numbers, several invoice attachments can be added to our CustCollectionLetter.

The relations are displayed as follows:

3. Add the field LACAddAttachments() to the query and then click Finish.

This field allows the docuref to be added several times/per line.

Attach the above Sales Invoice to the Collection letter

1. Navigate to Lasernet > Reports, find the Collection letter and click Attachments.

2. Click New to create a new line

3. Add the DocuRef table and only include the attachments with restriction External (should be the same restriction as set up in the Document Handling step).

The sales invoices will be attached to your CustCollectionLetter emails like this:

Additional information

In a Collection letter process, there are several interactions with the customer:

Collection letter 1

Collection letter 2

Collection letter 3


Consider if you need to include the sales invoices on all interactions.

If you decide to only include them in a specific interaction, then add a condition on attachments as follows:

1. Choose Query in Condition.

2. Click the Select button

The Inquiry opens

3. Choose table CustCollectionLetterJour and field CollectionLetterCode. Then you choose when you want the attachments to come. You can choose one or several.

In the example, we have chosen that we only want to include the attachments on the first Collection letter to the customer.

4. Click OK.

The above should be completed on FreeTextInvoice as well - to save that to DocuRef.

Keep in mind at the setup time - the system has not yet created the invoice PDFs to DocuRef for the reports that have already been printed in the past.

You can mark them in the Invoice journal and force rerun to make them go through LAC with the new settings - then they will get to DocuRef.

Use a filter - mark all, or several in invoice journal and resend to save time. 

Helpful Unhelpful

3 of 4 people found this page helpful