Advertisements

Mail Sending Option in NAV 2017 with Cover Letter & Attachments –Part 1

Generally we get demand for customized mail body to send from Navision. Normally we use templates or html etc. coding to achieve this. In NAV 2017 this feature is now available in product itself. Today we will explore this feature available for Std. documents and learn to setup, further in next step we will apply same to our custom documents and learn where all places we need to take care development to get it working.

The cover letters are created using RDLC or Word layout customization features providing visual consistency with any attached pdf document.

Document Layout for a Customer

MSI-01

For Example say we want to setup different e-Mail body for specific customer. To achieve this we will assign a specific report by customer which will enable us to process multiple formats at the same time. We will use the Customer Layout from the customer card by Document Type to do this.

MSI-02

In above example I am setting up a customized cover letter designed using selected report.

The Send To Email The e-Mail will be sent to the e-Mail provided in the customer card or you can provide an extra e-Mail in this field or you can specify at the time of sending mail if not setup automatic.

Email Body Layout Description = Modern – Email Body (Choose from the Custom Report Layouts)

Use for E-mail Body select this if you wish to include output of selected report as Cover Letter to Email body.

Send and Receive E-Mail

We can now use the Send Email window to have a preview of what our layout will look like and the using the options we can send the e-Mail.

Let’s open a posted invoice for this customer.

MSI-03

On the Posted Sales Invoice click Send, which will open a window with some options, such as:

We can choose Email Prompt for Settings or use Default Settings

We can select how the attachment needs to be attached

We can also have Disk options as PDF or Electronic Documents if we use those.

Click OK. Before e-Mail is sent, we have the possibility to verify the e-Mail address, the subject line, the attachments and as per the Email Body Template, this is how the e-Mail will look like:

MSI-04

When we click OK, an e-Mail is sent to the Customer using the e-Mail Template.

By opening the e-Mail the recipient can see the contents of the invoice which has been sent using the template and the full invoice is also available as an attachment.

MSI-05

You can switch to a manual written message:

By using the Message Content field or

If you are using a client, you can open and edit the message in Outlook

MSI-06

In our next part of this post, we will see how we can enable this feature for our custom Pages & Documents.

 

 

Advertisements

Appending other information to Navision Reports

There is always requirement from many customers to Append information to the Navision Reports.

Recently one of my reader have requested me for any such functionality which can help him Append information from Word or Excel Files to Navision Reports.

While searching for solution for such requirement i came across this scope if we can do the same from outside Navision integrating the functionality with Navision.

Although i am not sure how much this post will answere to the requirement raised by my this reader but still this can be an work around to this requirement.

In my previous 2 posts i have answered this approach, Let us assemble all of them to provide solution to this requirement.

Please see my privious posts, i will not repeat already covered part in this post. Here is the link to those posts:

Converting Office Files into PDF from Navision

Merging PDF Files in Navision

In this post i will be using these functions discussed in above posts.

The Same Setup will be applicable to this post too.

PDFConvMerge-2-2

Since we are appending our other information to the Navision Report so we will be at First Step saving our Customer Sales Invoice to PDF.

Later some information which need to be appended to this report is in Word File the path of which is stored on Customer Card.

How to work with Converting Office file to PDF is already discussed in previous post Link shared above.

So Now we have Our Report in PDF and Additional information to be appended to Report is also in PDF. Now it will be easy for us to Merge both the File to have single PDF File.

How to Merge these files is also already discussed in my previous post. Link shared above.

Let us see how we can assemble above both functionality to get our required result.

Approach is very simple, i have created a button on Sales Invoice to Print the Report which performs above discussed process.

PDFConvMerge-5

On Sales Invoice Page I have added one Button which calls my Function to Print & Merge the document, it takes Invoice No & Sell-to Customer No. as a parameter.

PDFConvMerge-6

I have created a function to Save the output of Report to PDF, using standard functionality available in Navision.

PDFConvMerge-7

The PrintSalesInvoice function called from Sales Invoice Page with Invoice No & Sell-to Customer No.

This Function calls the SaveReportAsPDF explained above.

Converts the Office file that is attached on Custommer Card, discussed in previous post Link provided above.

Calls the MergePDFFiles, discussed in previous post Link provided above.

So Now at single click of Button entire task is done for us.

To keep it simple no additional checks and other routine tasks have been included like after task is completed clean up of all temporary files and moving the Result file to desired Location etc.

Now you know the logic so you can tweak the code accordingly to get the functionality working as per your requirement.

Thats all for this post. I will come up with more information in my up coming posts.

You keep you requirements posting to me, i will try my best to answer your queries in form of my future posts, at earliest possible from my end.

Till then kee exploring & Learning.

Merging PDF Files in Navision

Many of time we have multiple files in pdf but for some certain reasons we require to merge them to single File.

Continuing from my previous post i am extending my functionality with Merging of Mulitiple pdf files to single pdf file.

PDFConvMerge-2-2

In my Setup Page created in previous post i have added one more field to store the Tool Path & File Name for Merging multiple files.

Based on the dll provided by http://www.pdfsharp.net this post is written.

Visit the Site download the utility and extract the dll file and exe file from the zip and store in same Folder.

The format of command to merge the files at command prompt is similar to:

Command to merge :- pdfmerge output=.\ActionFolder\result.pdf input=.\ActionFolder\1.pdf,.\ActionFolder\2.pdf,.\ActionFolder\3.pdf

We will prepare the Function which will take as parameter the Output & Input File and run the utility to Merge these files to single file using WsShell in Navision.

PDFConvMerge-4

Function is very simple to accept the Input & Output File Names and Prepare Single PDF file from multiple pdf files provided as input (comma seperated List of Files) to the function.

To keep it simple no additional codes for test and other routine job is not added. Now you are familiar with the functionality you can tweak the code accordingly to meet all other requirements.

Thats all for this post. Will comeup with more Information in my upcoming posts.

Till then keep exploring and learning.

 

 

Converting Office Files into PDF from Navision

Today in this post i will walkthrough how we can convert any MS Office File into PDF.

It have been many time required to convert any attached file with the record in Navision to PDF format.

To perform this action we will require a tool which can be downloaded from:

OfficeToPDF download link :- http://officetopdf.codeplex.com/releases/view/118190

Extract and save the OfficeToPDF.exe file to some Folder.

For this Walkthrough i have created a Field in Customer Table to save the File Path of the Office File which we want to convert into PDF.

PDFConvMerge-1

You can add Dialog box to select the File from the specified Folder.

For this demo i have kept it simple Text Field where you can add your File Path and Office File Name. It is assumed that only Office File will be attached here.

For Setup purpose i have created one Setup Table & Page where we will store our other required Folder paths.

PDFConvMerge-2

Here we have given provision to save the Path of the Office to PDF Convertor Tool file Path & Temporay working Folder.

I have used the shared folder for all the paths so that it is not system specific, also make sure you give required permission on this folder for all the operating accounts.

Now our Next task will be to write a function which will perform this conversion part.

PDFConvMerge-3

Above Function Takes the File Name from the Customer Card we stored above on Customer Card. Takes the Path of the Office To PDF Convertor Utility and Tmp working Folder.

Prepares the PDF file Name along with Path stored in Setup.

Prepares the command to invoke Convert Utility using WsShell and returns the PDF file File Name along with path as defined in the Setup.

Now you can use this File for futher purpose as required.

To keep it simple no additional code of test and other required routine task is not added.

Now you know the Logic you can tweak the functionality as per your requirement.

I will comeup with more information in my up comming posts, till then keep exploring and learning.

 

Important

Most of the contents you find in this blog will be either inherited from MSDN or Navision Developer IT Pro Help. Some places images are also directly taken from these sites. Purpose is simple to try those stuffs and re-produce adding few things as per my understanding to make easy understanding for others and quick reference.

Here nothing under my own brand or authorship of the content. At any point of time we are just promoting Microsoft stuffs nothing personnel with same.

Hope stuffs used here will not violate any copyright agreement with them. In case by mistake or in-intestinally it happens and the Microsoft feels these should not be used Microsoft have full right to inform me about same and will be glad to take down any such content which may be violating the norms.

Purpose is to promote Navision and share with community.

FB Profile

Like FB Page

%d bloggers like this: