Business Integration Solutions Documentation

Walkthrough: Sales Return Order

About this walkthrough

This walkthrough provides an overview on how to send a notifictaion for a sales return order.

You typically create a sales return order to compensate a customer who is dissatisfied with an item that you have sold them. This could be due to a quality issue or delivery of a wrong item.

Prerequisites

Template Description Default Report
NM_SALES.RET.ORD NM Template - Sales Return Order Confirmation Return Order Confirmation (6631)

Story

  • This connection uses the Record Change Event for "Modify" and it is linked to a specific internal document NM_RETURNORDERTRIGG which contains only two fields: the No and Status fields from the Sales Header (Document Type = Return) table.
  • This means, that as soon as a return order is getting released, 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 Sales 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_SALESRETURNORD 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.

RO User Event

Task

Setup

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

RO 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 release it.
  2. Open notification NM_SALES.RET.ORD and observe that the released return header has been captured by the Record Change Event activity
  3. Process the notification.

Result

RO 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 Return Order Confirmation report.

For a brief guide, see Papercut SMTP setup