4 Jul’17

Dynamics NAVTo run a batch to check for visa expiry date of employees and send an email if visa expires in a month in Dynamics NAV


This article focuses on to creating a batch to run everyday to check for employee’s visa expiry date. If the visa expires in a month an email notification is sent to the HR Manager about the visa expiry of the respective employee.


Microsoft Dynamics NAV 2017


  1. Create a new codeunit with id and name.
  2. Set up the SMTP mail setup in NAV.

3. In the Globals (Ctrl+G),create a record for employee table.

4. Create a function and call it on run.

5. Here in the above code calculate the previous months date of the visa expiry date and if the the date is today then an email is send using smtp mail

6. Create a job queue to run every day. Set the start time and end time.

7. An email is sent if today’s date is the previous month date of visa expiry.


Written by

Chris D'Silva

Software Developer

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