Business Integration Solutions documentation

Walkthrough: Sales Credit Memo

About this walkthrough

This walkthrough provides an overview of how to send a notification for a credit memorandum.

A credit note or credit memorandum (memo) is a commercial document issued by a seller to a buyer. The seller usually issues a credit memo for the same or lower amount than the invoice, then repays the money to the buyer or sets it off against a balance due from other transactions.

Prerequisites

Template Description Default report
NM_SALES.CR.MEMO NM Template: Sales Credit Memo Sales - Credit Memo (1307)

Story

This connection uses the following pipeline elements:

  • A Code Event triggers the pipeline. On the Posted Sales Credit Memo page (page 134), add a new button with a few lines of code: see Code Event Setup. When a user selects this button, the Code Event detects it.
  • The XML Generator activity creates an XML file based on an internal document.
  • The Splitter activity creates one message for each sales credit memo.
  • The XML Minifier activity cleans the message of empty nodes and blocks that are not mandatory.
  • The message passes through the XMLSchemaValidator, which verifies that the XML message respects the internal document structure.
  • The Header Mapper activity adds the headers to the message body, filling in the recipients and email subject.
  • The XML to HTML Translator activity creates an HTML email message based on your branding templates. You can also configure an HTML body manually.
  • The Attachment Generator activity adds attachments to the email message based on standard Microsoft Business Central report functionality.
  • The Email Writer endpoint sends the email.
  • The internal document NM_SALESCRMEMO contains all the information needed 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 lets you define a personalized email message.

SCM Notification

Task

Setup

  1. Import the NM_SALES.CR.MEMO.zip configuration package, or use the BIS template if available.

    SCM Notification

  2. Add a new email account in Email Accounts, then select SMTP Account to send notifications via the Papercut SMTP server.

    Email Account

  3. On the notification page, edit the EMAILWRITER and add the Account ID created in the previous step. Run the configuration once.

    Settings

Process

  1. Create a sales credit memo and post it.
  2. Open the Posted Sales Credit Memo page.
  3. Select the Code Event button on the page (Send Notification).

Result

SCM Result

The mail sends to all recipients. Using Papercut, the mail is captured in the demo environment, showing a preview of the HTML mail body and a PDF attachment of the Sales - Credit Memo report.

For a brief guide, see Papercut SMTP setup.