Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
On Customer Master page, an action button is created called Email customer, on click of the action button, an email has to be sent to the respective customer with attachment of the invoices in a .pdf format. Here, the report is saves as .pdf file.
This report has a request page where Start Date and End date are entered by the user. Based on the date ranges, invoices generated for the particular user is mailed to the customer.
Microsoft Dynamics NAV 2017
2. In the Function InvoiceMail, declare a parameter CustNo. and the variables as follows:
Here CustTempTable is a Temporary table
The Code is added as follows:
InvoiceMail(Custno : Code) -Function Name
IF CustomerTable.FINDFIRST THEN BEGIN
SMTPMail.CreateMessage(”,SMTPMailSetup.”User ID”,EmailID,’Invoice Statement from CompanyName‘,”,TRUE);
SMTPMail.AddAttachmentStream(IStream,’Customer Invoice’+ CustomerTable.Name+’.pdf’);
SMTPMail.AppendBody(‘Please find attached your Customer Invoice statement’);
SMTPMail.AppendBody(‘This is a system generated mail. Please do not reply to this mail!’);
MESSAGE(‘Mail sent to Customer %1’,Custno);
1. Set the SMTL Mail setup in the Role Tailored Client. Click on Apply Office 365 Server Settings. Add the Sender email (comapny email in my case) in User ID field and password of the email id in the Password field.
2. Store the Customer Email in the Email ID variable.
3. Pass the filters applied to the CustomerTable to the report variable CF_FTLCustomerInvoice.
4. Run the request page. The Run request page passes the request parameters in an xml format which is stored in a text variable XmlParameters.
5. Create an OutStream to save the the XmlParamters received in a File Parameters in a .xml format.
6. Create Instream to read the .xml file.
7. REPORT.SAVEAS(50011,XmlParameters,REPORTFORMAT::Pdf,OStream); saves the xmlparameters from the outsream in an pdf format.
8. Use SMTPMail.CreateMessage function to enter the sender’s and receipient’s email, Subject etc.
9. Add the attachement from the InputStream.
10. Draft a body of the email and Use SMTPMail.Send to Send the email. Yay.Email is Sent!
1.Click on Action button, Request page opens.
2. Enter the Start date and End date and click on OK.
3. An email is sent to the customer.
Overview of the blog, first setup the SMTL Mail setup. Create an action button and create a function call. In the function defination, code as above and email is sent
Business Applications communities