AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.08.2017, 07:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
saurav-nav: Microsoft Dynamics NAV 2017 - Email From NAV Part 3.
Источник: http://saurav-nav.blogspot.com/2017/...l-from_21.html
==============

Hi Readers,

Let's continue what we are discussing from Last two weeks.

To understand the content of this article and use the pattern we are about to discuss in this article you need to go through old articles.

If you haven't read the Part 1 and Part 2 below are the links for same.

Part 1 - Send Email from Navision using a Pattern provided by Microsoft in New version.

Part 2 - Develop a Word Layout for Sales Shipment Report.

In this last article, we will discuss how to use the Pattern & Word Layout for sending an Email.

The idea is Simple - Using word Layout for the Email Body and then use Email Pattern to send Email.

Without Further Delay, let's discuss how we can configure & customize same in NAV 2017.
Thanks to Mohamed Zayed and hope this solves your issue.

** What we are customizing is already part of standard NAV. The article is just for an explanation how to customize if required to be added in some other NAV areas.


1. As we discussed in Part 2 we can have multiple word layout for the same report. These Layouts can be used for other usages than sending the email. So somewhere we need to setup which of the multiple layouts should be used for Emailing from NAV.


Microsoft Have added word layout selection in Report Selections. As shown below I will select the word layout that we created in Last Post.




2. Now Let's add some code for the new pattern that we want to use. New Function Name is SendSalesShipment which accept the record and returns Email is Sent or Not.


Functions Do Pre-Check, we can add more if required. After that, it uses the same Pattern as in Article 1.
While using pattern we use three Functions, shown below -
a. Get Report ID and Word Layout Code to be used.
b. Generate Email Attachment as PDF.
c. Generate Email Body.


After Doing all this, Function sends an email and return if the email is sent.




3. So What these functions Do?


a. GetReportIDandLayoutCode -
This Function looks up of Report Selection table for the Shipment Report and get the report id and also the Layout code.


b. GenerateDocumentEmailAttachment -
This function creates a new pdf file, and use SAVEASPDF using the Report ID from the first function and then exit the File Path for attachment.


c. GenerateShipmentEmailBody -
This function creates a new temp HTML file. select the word layout and use SAVEASHTML to save word layout file. The word layout file path is sent back to the pattern function which is used to pass to the Body File Path.




4. Add a function in Sales Shipment Page for Sending Email.




5. Here is the Email that is sent from NAV.






Hope it helps.


Let me know if it makes sense there are so many additional features in this pattern that I would like to explain if this article helps my readers.


Waiting for your reply.


You can download the codeunit from OneDrive.

File Name- Microsoft Dynamics NAV 2017 - #SauravNAV_Email_Pattern_V2.0


Let me know your views.


Regards,
Saurav Dhyani
saurav-nav.blogspot.in



Источник: http://saurav-nav.blogspot.com/2017/...l-from_21.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
waldo: Microsoft Dynamics NAV 2017 – what’s really new? Blog bot NAV: Blogs 0 13.10.2016 05:22
NAV Team: Upgrading from Microsoft Dynamics NAV 2009 R2 or Microsoft Dynamics NAV 2009 SP1 to Microsoft Dynamics NAV 2015 Blog bot Dynamics CRM: Blogs 0 23.02.2015 13:00
NAV Team: How to: Set up your Microsoft Dynamics NAV installation for Single Sign-on with Office 365 using Windows PowerShell Blog bot Dynamics CRM: Blogs 0 19.12.2013 15:10
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 13 Blog bot Dynamics CRM: Blogs 0 27.03.2013 22:12
dynamics-community-at: NAV 2009–Mail from mbsinsight Blog bot Dynamics CRM: Blogs 0 04.04.2011 10:55
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:19.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.