Business Integration Solutions Documentation
Walkthrough: Sales Invoice
About this walkthrough
This walkthrough provides an overview on how to send a notification to your business partner regarding itemized ststement of goods or services.
Sales Invoice is an itemized statement of goods or services provided to a business partner. It indicates the quantity and price of each product delivered.
Prerequisites
Template | Description | Default Report |
---|---|---|
NM_SALES.INVOICE | NM Template - Sales Invoice | Sales - Invoice (1306) |
Story
- This connection uses the Record Change Event for "Insert" and it is linked to a specific internal document NM_SALESINV.TRIGG which contains only one field: the No field from the Sales Invoice Header table.
- This means, that as soon as a new record is inserted in the Sales Invoice Header table, the new record is detected by the Record Change Event.
- Once the Pipeline is triggered, the XML Generator Activity will create an XML-file, based on an internal document.
- It is recommended to add the Splitter Activity, which results in one message for each Posted Sales Invoice.
- The XML Minifier Activity is used to clean the message of empty nodes/blocks that are not mandatory.
- The message is taken through the XMLSchemaValidator which makes sure the XML-message respects the internal document structure (ex. all the mandatory nodes are in the structure).
- The Header Mapper Activity is adding the headers to the message body, so the recipients and the E-mail subject are filled in.
- The XML to HTML Translator Activity allows you to create an HTML E-mail message, based on your branding templates, but it is also possible to configure an HTML body manually.
- Based on the standard Microsoft Business Central reports functionality, the Attachment Generator Activity is adding attachments to the E-mail message.
- The E-mail is send via the Email Writer Endpoint.
- The internal document NM_SALESINV contains all the information you need to configure the XML Generator activity, the Splitter activity, the Header Mapper activity and the XML to HTML Translator activity.
- Adding other fields to this document allows you to define a personal E-mail message.
Task
Setup
- Import NM_SALES.INVOICE.zip configuration package or use the BIS template if available.
- Add a new Email Account in Email Accounts, then select SMTP Account to send notifications via Papercut SMTP server.
- On the notification page edit the EMAILWRITER and add the Account ID which is created in above step run the configuration once.
Process
- Create a sales invoice with some details on it and post it.
- Open notification NM_SALES.INVOICE and observe that the posted sales invoice header has been captured by the Record Change Event activity
- Process the notification.
Result
The result is that the mail is sent to all receipients. By using papercut, instead of sending it to receipients, we've captured the mail on our demo environment, with a preview of the HTML mail body and a PDF attachment of the Sales - Invoice report.
For a brief guide, see Papercut SMTP setup