14 Nov’16

Dynamics NAVEmail 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

  • Dynamics 365 Client Diagnostics

    15 March’ 2018

    Main cause of Performance Issues: Bandwidth and latency are the primary characteristics which affects the performance o...

    Read more
  • Closing Blind Shift in MPOS and CPOS in Dynamics 365 for Retail

    15 March’ 2018

    Manual For closing Blind shift in POS: Blind shifts terminate the currently ongoing shift and when logged in a new shif...

    Read more
  • Persistent Filters in the Power BI Service

    13 March’ 2018

    Introduction: The feature is finally release, and it is power BI has announced general availability of persistent filt...

    Read more
  • Cause and Solution for Scribe MSMQ not receiving Message from AX

    10 March’ 2018

    Issue: Microsoft Message Queuing (MSMQ) service running on Server might be unable to receive messages. Therefore, messa...

    Read more
  • User Privileges on SharePoint – D365 Document Integration

    10 March’ 2018

    Overview: Often, we wonder what could be wrong where we see a generic error on Documents in Dynamics 365. Something lik...

    Read more