web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Auto sending PDFs as attachments NAV 2016

(0) ShareShare
ReportReport
Posted on by

I've got a request to have the Vendor remittance PDFs attached to emails and sent out automatically. 

I found this same guide across the net three times: 

http://ishwar-nav.blogspot.com/2015/07/send-mail-with-pdf-attachment-in-nav.html

https://community.dynamics.com/nav/b/technicaltipsandtricksfordynamicsnav/archive/2015/07/31/creating-file-attachment-to-mail-for-report

https://dynnavashwini.blogspot.com/2015/07/creating-file-attachment-to-mail-for.html?showComment=1505144008566#c6673081894226421126


I also started a post on DUG here:
https://dynamicsuser.net/nav/f/developers/93711/auto-emailing-remittance-advice-with-nav-16 

user sbhtbng replied with: 
Step 1 - Right where you are printing the remittance add a option for Emailing
Step 2 - Save the report as PDF 
Step 3 - Write a code to get the to email id where this document should go. Create the subject and body for the email.
Step 4 - Add the report as an attachment.
Step 5- Send the attachment as email.


I'm attempting to follow the guide linked above to accomplish this.

When I go to save my new codeunit I get an error message about 

objScript.Language not being setup in cal globals. Looking at three examples of the solution above I don't see any mention of having to define any objscript things beyond the initial setting of the objScript Variables subtype to Microsoft Script Control 1.0 "ScriptControl".

I'm scouring the net for info on objScript or using VB within NAV codeunits but coming up kind of short. 


Before I keep troubleshooting I wanted to check with you kind folks to make sure I'm on the right path here. 

thanks so much, this one has been a bear. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: Auto sending PDFs as attachments NAV 2016

    I had an extra 'Language' within the code throwing the Variable Error.

    Working on implementing the whole thing now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans