Business Integration Solutions Documentation

Walkthrough: Sales Return Receipt

About this walkthrough

This walkthrough provides an overview on how to send a return receipt to the customer for the returned item.

Prerequisites

Template Description Default Report
NM_SALES.RET.RECP NM Template - Sales Return Receipt Sales - Return Receipt (6646)

Story

  • This connection uses the Record Change Event for "Insert" and it is linked to a specific internal document NM_SALESRETRECPTTRIG which contains only one field: the No field from the Return Receipt Header table.
  • This means, that as soon as a return order is received, 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 received return order.
  • 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_SALESRETRECPT 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.

RR User Event

Task

Setup

  1. Import NM_SALES.RET.RECP.zip configuration package or use the BIS template if available.

RR Import

  1. Add a new Email Account in Email Accounts, then select SMTP Account to send notifications via Papercut SMTP server.

Email Account

  1. On the notification page edit the EMAILWRITER and add the Account ID which is created in above step run the configuration once.

REM Settings

Process

  1. Create a sales return order with some details on it and receive it.
  2. Open notification NM_SALES.RET.RECP and observe that the return receipt header has been captured by the Record Change Event activity
  3. Process the notification.

Result

RR 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 - Return Receipt.

For a brief guide, see Papercut SMTP setup