Business Integration Solutions Documentation
Walkthrough: Sales Credit Memo
About this walkthrough
This walkthrough provides an overview on how to send a notifictaion for a 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, and 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 a Code Event to trigger the pipeline.
- On the Posted Sales Credit Memo page (page no. 134) you can add, with a few simple lines of code, a new button, for reference see Code Event Setup
- When a user presses this button, it will be detected by the Code 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 Credit Memo.
- 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_SALESCRMEMO 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.CR.MEMO.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 credit memo and post it.
- Open the Posted Sales Credit Memo page.
- Click the Code Event button on the page (Send Notifictaion).
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 - Credit Memo report.
For a brief guide, see Papercut SMTP setup