14 Nov’16

D365 Business CentralEmail on Releasing and Posting of Purchase Order, Sales Order and Journal


In this article we send emails on releasing and posting of purchase order, sales order and journal. We send emails with attachments in .pdf format to the respective users. For Purchase order the email is sent to the respective Vendor regarding the successful posting of orders. For Sales order email with attachment is sent to customers and in General journal the email is sent to the users.


  1. Microsoft Dynamics NAV 2017 with a developer license.
  2. Page 42 Sales orders, page 50 Purchase order, Page 39 General Journal
  3.  Codeunits 400 for SMTP Mail setup, codeunit 419 File management
  4. Table 409 For SMTP Mail, Table 91 user setup.

Purpose of the Setup

The purpose of this setup is to send emails with attachments on releasing and posting of purchase and sales order and on Posting of General journal in NAV 2017.


  1. Configure the SMTP mail setup. Enter the sender’s email id in the USERID and password of the sender in the password field. The authentication is basic. Enter the appropriate SMTP server and port number.
  2. Write a codeunit for sending email with attachment

    Here SendEmailWithAttachment is a function in the codeunit.

    This codeunit Fetches the Customer email address. Using SMTP Mail it attaches the attachment in .pdf format and then sends the email.

  3. In the Respective Page, Call the codeunit in the Post and Release action button using the following command.
  4. In the NAV front end create a new sales order and post it. This send the email to the respective customer.

    The same procedure is applied for Purchase order and General Journal.


The Email automatically is send to the customer, vendor or user with the attachment on Posting and on release action.


Written by

Team Member


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.

Want to streamline your business processes?

  • This field is for validation purposes and should be left unchanged.

Recent Articles

  • Reading more then 10K records in D3FOE OData API

    11 July’ 2018

    Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time usi...

    Read more
  • Paging in D365 Customer Engagement v9.0

    10 July’ 2018

    Introduction: The Xrm.retrieveMultipleRecords method is used to retrieve a collection of records in Dynamics 365 Custom...

    Read more
  • Set up Dynamics 365 connection in Microsoft Social Engagement

    10 July’ 2018

    Introduction: This blog explains how to Set up Dynamics 365 connection in Microsoft Social Engagement. Steps to be follo...

    Read more
  • Voice of the Customer failed to install

    10 July’ 2018

    Introduction: Many people face issues in installing Voice of Customer solution on v9 environment and trying repeatedly ...

    Read more
  • Scribe Insight AX as a Web Service Find Block issue

    10 July’ 2018

    Introduction: If we need to look up for any value from AX then we do it by using a Find Block in Scribe Insight Eg: Basi...

    Read more