Thursday, October 4, 2018

Business Central Web Client Search Improvements

With the release of Business Central OnPremise one major change they introduced is the UI of the web client.  It is same UI which was released earlier for Business Central Cloud Version. It has rich interface and the look and feel is way different then earlier versions.


We always used to use the search for finding pages/reports but with new search they have broadened the scope and now can search can be used to find the actions available on that page. As shown below on the Sales Order Page, when I search for post it displayed the actions with that name and also other pages. You can directly launch those actions from this page or open other pages.

The new search is called “Tell Me” and you can access Tell Me from anywhere from the application and the keyboard shortcut  is Alt+Q


This is a great improvement and very useful when you have lot of actions on a page.


Wednesday, October 3, 2018

Business Central OnPremise DEV License Error (Update)

Update: This issue is resolved now. You need to regenerate your license and it should work.

I have installed Business Central On Premise and uploaded over DEV license. Unfortunately the license did not work and I keep getting the below error


I am getting the same error on the Web Client. Initially, I thought it may be an issue with the license or how it was generated but a quick search found the below twitter post which mentions it is a known issue and they are working on it.



But the question is how do I access the client now, so I tried to upload the license which I found on the DVD in the below path and the same license file (Cronus.flf) is also located in few other folders on the DVD, but none of them worked.

RoleTailoredClient\program files\Microsoft Dynamics NAV\130\RoleTailored Client

The license we need in this case is not Cronus.flf but Master.flf which is located in the SQLDemoDatabase folder. This let me login into Business Central Web Client and RTC.

I hope the DEV license error will be resolved soon.


Tuesday, October 2, 2018

Good Bye to C/AL and RTC Client

There are several new things and lot of information is being shared during Directions NA. Unfortunately I was not there but the community was so active sharing the news through twitter posts /blogs which really helps people who did not attend.  Thank you everyone for sharing the information.

One thing they announced was Dynamics 365 Business Central Road Map. As you can see it clearly shows by 2020 the only client available would be Web Client and the Programming language is AL. Although, I am not sure how this will end up by 2020 but based upon the progress we have made in last couple of  years it is quite possible.


Although we still be using CAL / RTC client on older versions this will fade away as people upgrade or try to take the advantage of SAAS version of Business Central.

There are lot of improvement being made every month with AL, whether it is adding more events to subscribe or new functionality to make it available.

You can also become a contributor to the AL on GitHub for more information please check the following link


Dynamics 365 Business Central On Premise


On October 1st, during DirectionsNA it is officially announced that Dynamics 365 Business Central On Premise will be available to download.

You can download the software if you have Partner Source Access ,from here Download

One of the big difference/change in this version is the Web Client and its features.


You can also use docker to build Business Central On Premise  please check the following link for more information


Wednesday, September 19, 2018

Connection Error while launching debugger in NAV

Recently I was working on a project where we have switched the authentication from Windows to NAVUserPassword.

To access different databases and instances we have created different config files and have used them in our shortcut to launch them, everything was working fine but when I try to debug an issue, I was getting the following error, which complains about the DnsIdentity


The key is when  you launch the debugger it uses the config file (ClientUserSettings.config.) located at C:\Users\YourUserName\AppData\Roaming\Microsoft\Microsoft Dynamics NAV\70 and depending on the version you are on it would be 80 or 90 folder. It does not use your custom config files you have created to launch the application.

So, you need to make sure this file is also updated with proper authentication using the ClientServicesCredential which should be NAVUserPassword if you are using UserName/Password. In my case everything was set properly except the DnsIdentity Property value which is blank.

Once I updated the DnsIdentity Value with proper subject name which is the CN name , the debugger started without any issues.

For more information about DnsIdentity and Certificates please check the following link


Tuesday, April 3, 2018

Dynamics 365 Business Central Trial and How to Reset SandBox Environment

If you want to try the new Dynamics 365 Business Central please login into, and you just need to provide your work email address and Phone No.

If you already have signed up previously then, on login it will redirect you to the Finance and Operations Business Edition and to reset to Business Central you need to follow the below steps

Once you login, Go to your Apps and Select the Financials App for the production instance, Sandbox Environment Setup

Choose the Search for Page or Report icon, enter Sandbox Environment, and then choose the related link.

In the above screen you need to Reset the Sandbox Environment.

It will take a minute or two to complete the process and might show up an error screen at the end but don’t worry, you just need to logout and re-login which will reset your environment to the new Business Central Edition as shown below


If you have any other tips or suggestions, please do share them in the comments below.


Monday, April 2, 2018

Dynamics 365 Business Central is now live!

A modern solution for modern businesses

With 160,000+ customers, more than 2.7 million users, and 3500 partners worldwide, Dynamics NAV has sold in 195 countries – that’s pretty much every country in the world. Today we are proud to announce that we are furthering this success story with Dynamics 365 Business Central by making it generally available as a cloud service starting today.

Dynamics 365 Business Central brings the full power of Dynamics NAV to the cloud. As such, Business Central has at its foundation a set of trusted, proven technologies in a single, end-to-end application. As such, Business Central offers:

  • Business without silos. Unify your business, and boost efficiency with automated tasks and workflows—all integrated within familiar Office tools like Outlook, Word, and Excel.
  • Actionable insights. Achieve greater outcomes and gain a complete view of your business with connected data, business analytics, and guidance delivered by Microsoft’s leading intelligent technologies.
  • Solutions built to evolve. Start quickly, grow at your own pace and adapt in real time with a flexible platform that makes it easy to extend Business Central based on your changing business needs.

For an intro to Dynamics 365 Business Central, view the announcement made by Alysa Taylor here:

Announcing Dynamics 365 Business Central

If you would like to go deeper, enjoy this video:

Dynamics 365 Business Central Deep Dive

Finally, Business Central would not be possible without the amazing team that is behind this great product. I cannot express enough how proud I am of them and what they have accomplished. To hear from some of the team members about what their favorite features are, see this:

Our favourite capabilities in Dynamics 365 Business Central

Because Dynamics 365 Business Central and Dynamics NAV run the same application code base, this empowers us to smoothly transition all our Dynamics NAV partners and customers into Dynamics 365 Business Central. Dynamics 365 Business Central is a cloud first solution, designed for the age of digital transformation powered by the cloud. But it will not be a cloud only solution. In the fall it will be available for self-deployment on premise and in the intelligent edge for customers that prefer that option. For the existing partners and customers, this will be just another upgrade, like they would do for Dynamics NAV, with a name change. For customers interested in the cloud, starting today, Dynamics 365 Business Central offers unprecedented opportunities to drive transformation of the customers’ businesses, increasing their business performance through the power of Microsoft cloud technologies and services.

For more information on coming updates, please keep an eye on the roadmap site.

Dynamics 365 Business Central will be generally available on April 2, 2018 in 14 countries – United States, Canada, United Kingdom, Denmark, Netherlands, Germany, Spain, Italy, France, Austria, Switzerland, Belgium, Sweden, and Finland, and will be sold through our Cloud Solution Provider (CSP) partners. Australia and New Zealand will be generally available beginning July 1, 2018. Our network of global partners has the expertise to help you create and deploy a solution that meets your industry-specific needs. Do even more with Dynamics 365 Business Central using pre-built applications, available through the AppSource marketplace, to easily and cost effectively extend your solution.

You can try Dynamics 365 Business Central today by browsing to our homepage and starting the free trial. Looking forward to hear your questions, feedback, and thoughts on our community forum, ideas site. You can also follow news and discussions on Twitter, using the #MSDyn365BC hashtag.



Wednesday, January 31, 2018

New PowerShell Cmdlets in NAV 2018


Following are the new PowerShell cmdlets introduced in NAV 2018




Restarts a Dynamics NAV Server instance.


Starts a Dynamics NAV Server instance.


Stops a Dynamics NAV Server instance.


Sets the application version or application family fields in the application database connected to the specified Dynamics NAV Server instance.


Specifies settings for a tenant that is mounted on a Dynamics NAV Server instance.


Upgrades a NAV App to a specified tenant.


Synchronizes an app to the specified tenant's database.


Job Queue Entry is Missing/Deleted


Last week one of the issues i have received is the Job Queue entry which was scheduled is missing or getting deleted after it is run, if you are one of those who is having this issue then below is the reason for the issue.

T he Job Queue Entry gets deleted is because of the way we setup the job queue to run, when we setup the Job Queue it has options to setup as Recurrence which we basically telling the system to run this Job on a specific day at a specific time


If we don’t setup this tab and then it is more like one time job you want to run and in that case once the Job is ran it will delete the entry.

If you have any other tips or suggestions, please do share them in the comments below.


Tuesday, January 16, 2018

Cumulative Update 01 for Microsoft Dynamics NAV 2018 has been released

Cumulative Update 01 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2018.

The cumulative update is intended mainly for solutions that are experiencing the problems described in the Knowledge Base article linked to below. However, you are advised to always keep your solution updated with the latest cumulative update. If you are in doubt about whether this cumulative update addresses your specific problem, or if you want to confirm whether any special compatibility, installation, or download issues are associated with this cumulative update, support professionals in Customer Support Services are ready to help you. For more information, see

The cumulative update includes hotfixes that apply to all countries and hotfixes specific to the following local versions:

Where to find Cumulative Update 01

You can download the cumulative update from KB4058601  – Cumulative Update 01 for Microsoft Dynamics NAV 2018.

You can press one of the countries in list above for a direct download or you can download the cumulative update from the Microsoft Download Center.

Microsoft Dynamics NAV 2018 is also available from containers. Containers are a way to wrap up an application into its own isolated box, you can pull the cumulative update container from the Docker Hub.

To learn more about other Cumulative Updates already released for Microsoft Dynamics NAV 2018 please see KB  4072483.


Before you install a cumulative update in a production environment, take the following precautions:

  1. Test the cumulative update in a non-production environment.
  2. Make a backup of the system or computer where the cumulative update is to be installed.
  3. This Cumulative Update can require a database upgrade.

Additional Information

For information about how to install the cumulative update, see How to Install a Microsoft Dynamics NAV 2018 Cumulative Update.



Sunday, January 14, 2018

Print the document to a specific printer


In one of my previous posts, I have discussed how to download and print a remote file. Here is the blog link

The solution in the above post will print the file to the default printer and recently I was working on a modification where I have to print the file to a specific printer instead of the default printer and couple of readers of my blog post also asked how to do this, so I would like to share today the solution for it.

I was checking online to modify my old solution to print to a specific printer and few suggested to me to use the arguments property of the ProcessStartInfo and also the below MSDN example suggests the same, but unfortunately, I was not successful using that property.


To solve this issue I have found another solution which is to use the Print Document and in fact, I think this is an easy solution when compared to the other solution in my previous post.

Below is the function for it.

PROCEDURE PrintFile@1000000018(FilePath@1000000002 : Text[250]);


PrinterName@1240060002 : Text;

PrintDocument@1240060003 : DotNet "'System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Drawing.Printing.PrintDocument";

PrinterSettings@1240060004 : DotNet "'System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Drawing.Printing.PrinterSettings";


PrinterName := 'MF8200C Series';

PrintDocument := PrintDocument.PrintDocument;

PrintDocument.DocumentName := FilePath;

PrinterSettings := PrinterSettings.PrinterSettings;

PrinterSettings.PrinterName := PrinterName;

PrintDocument.PrinterSettings := PrinterSettings;




If you have any other tips or suggestions, please do share them in the comments below.

Friday, January 5, 2018

January 2018 Cumulative Updates for NAV 2013, 2013 R2, 2015, 2016 and 2017

Here are links to the release notes and download link for the CU's released.

NAV 2013 – Cumulative Update 58

You can download the cumulative update from KB4058596

NAV 2013 R2 – Cumulative Update 51

You can download the cumulative update from KB4058597

NAV 2015 – Cumulative Update 39

You can download the cumulative update from KB4058598

NAV 2016 – Cumulative Update 27

You can download the cumulative update from KB4058599

NAV 2017 – Cumulative Update 14

You can download the cumulative update from KB4058600


Thursday, January 4, 2018

Could not Load file or Assembly error after applying Cumulative Update


Last week I have applied the Cumulative Update 50 for NAV 2013 R2 on my local machine.  After I have applied the Cumulative Update I have tried to open NAV Administration Tool to restart the NAV Services but I have encountered the below error


The tool was not able to open the management dll , so I have browse to the service folder and reviewed the properties of Microsoft.Dynamics.Nav.Management.dll and found that it was blocked.

To unblock the dll I have clicked the Unblock check mark as shown in the below fig. and then tried to open the NAV Administration tool which then opened without any issues

If you get could not load file or assembly, be sure to check the properties of the file.


If you have any other tips or suggestions, please do share them in the comments below.


Wednesday, December 13, 2017

Batch Name disappears after you customize the Journal Page


Batch name drop-down disappearing on the journal pages in NAV 2013 and NAV 2013 R2 is an old issue but this issue resurfaced again this week couple of times for a client, so I have decided to write a blog on it.

This is a known bug in NAV 2013  & NAV 2013 R2 and can be fixed easily by applying the latest platform hotfix but if you are not planning to apply the hotfix then below solution will fix the issue for you

In this example, let’s look at the whse. physical inventory journal page

After I have customized the page, the page will look like in the below fig, and there is no way to add the batch name back to the page and this issue is user specific.


In order to resolve this issue, you need to open the development environment and find the table 2000000075 (User Metadata) and 2000000080 (Page Data Personalization), and run those tables and filter for the page no. . In this case I have filtered the Page ID column  (Whse. Phys. Inventory Journal Page is) to 7326 and the User ID column to my user ID.

Once you find that record, please delete that record from the table and perform the same steps in Page Data Personalization table and use the Object ID column instead of Page ID.


Compile the page and the batch name should appear on the journal page.

If you have any other tips or suggestions, please do share them in the comments below.


Tuesday, December 12, 2017

New COMPANYPROPERTY function in NAV 2018


One of the new functions which were introduced in NAV2018 is COMPANYPROPERTY which has two properties

DISPLAYNAME: Which will return the display name from the company record

URLNAME: Which will return the name in the URL Format.

You can setup the Display Name on the company page as shown in the below figure:


As per Microsoft documentation, the change of display name now has immediate effect on reports as well as displaying the company name in the UI of the client

I have tried to the change the Display Name for testing but the change is not reflected on the RTC client, it did reflect in reports and in the web client. It would be nice if the same change is reflected in the RTC client when the System Indicator Company is used.



The URLNAME function returns the following output


One issue I have noticed is if we go to the company information card and make any change to the system indicator the display name is reverted to the original company name.

If you have any other tips or suggestions, please do share them in the comments below.


Sunday, December 10, 2017

Using Placeholders in NAV Reports


Placeholders provide a method to customize the formatting and insert as an expression inside the textbox.

To add a placeholder, click inside the textbox, then right-click and select Create Placeholder as shown in the figure.



Modifying or removing a field in a standard report like Sales Order (10075) is a pain because all the textboxes show their expressions as <<Expr>>, as shown below. Trying to identify which textbox contains the field that you want to modify or remove could be tiring.


If we have used Placeholders inside the textbox then it will be much easier to identify them as Placeholders not only allows you to add expressions but also gives you the option to add Labels to it. The labels will appear on the report layout as shown below.


Microsoft does a good job in naming the textboxes so it is easy to identify them using the name, for example if I look at the same report in Document Outline you can see how they named

The advantage with placeholder labels is you can view that in design mode.


Placeholders also have the ability to format the text differently. You can add more than one Placeholder in a textbox. Similar to Textboxes, Placeholders also have many tabs as shown in the figure below, which will allow you to format and customize text accordingly.

You can add more than one placeholder in a single text box and format each placeholder differently.

One other advantage of Placeholder is, it has the option to Interpret HTML tags. You can add configure your expression to render using HTML formatting. This allows us to add HTML tags directly into the expression, such as line break, font, bolding, underline….

For example, we can use the following expression in the Value field, and select the HTML option for Markup type in the above figure.

<font face="Arial"><b>T </b></font> ' + “Phone No." + '<br>'

If you have any other tips or suggestions, please do share them in the comments below.


Tuesday, December 5, 2017

December 2017 Cumulative Updates for NAV 2013, 2013 R2, 2015, 2016 and 2017

Here are links to the release notes and download link for the CU's released.

NAV 2013 – Cumulative Update 57

You can download the cumulative update from KB 4055888

NAV 2013 R2 – Cumulative Update 50

You can download the cumulative update from KB 4055889

NAV 2015 – Cumulative Update 38

You can download the cumulative update from KB 4055890

NAV 2016 – Cumulative Update 26

You can download the cumulative update from KB4055891

NAV 2017 – Cumulative Update 11

You can download the cumulative update from KB4055892


Connection refused error on NAV when connecting to web services


When you try to access Navision Web services you may encounter the following error

This Site can’t be reached, xxxx refused to connect”

The most common reason for this error is the NAV Service is not enabled for SOAP/OData.

To enable these services, open the Microsoft Dynamics NAV Server Administration tool and select the SOAP Services Tab/ OData Services Tab  and make sure the property is set to true

Enable SOAP Services and Enable OData Services to true, if you are using SOAP you just need to enable SOAP and vice versa.


You can also use the Powershell Cmdlet

Set-NAVServerConfiugration to enable the services for example to enable OData you use the following cmdlet

Set-NAVServerConfiguration -ServerInstance <ServerInstance> -keyname ODataServicesEnabled -keyvalue true

Replace <ServerInstance> with the name of the Microsoft Dynamics NAV Server instance on which to set up OData services.

Check the following link for more examples

One other reason for this error is because the port is blocked and you need to create an inbound rule to allow it.

Please check this below the article you need to do the same for the web services port

If you have any other tips or suggestions, please do share them in the comments below.


New System and Hidden Tables in NAV 2018


The following new system tables are added in NAV 2018


Two new hidden tables are added in NAV 2018


The new hidden table and new feature in NAV 2018 is API’s and when i run this table it listed the following API, in my next post I will see how can we can enable API on NAV 2018 and access one of those using the endpoint


If you have any other tips or suggestions , please do share them in the comments below.


Friday, December 1, 2017

Dynamics NAV 2018 is available to download

The much waited NAV version is now available to download, with lot of new features. Please download the software from the below link

You can check what is new in NAV 2018 in this document

Some of the new features in this release are

Image Analyzer

Power BI reporting Control

Better OCR Integration

Preconfigured Excel Reports

Bulk Posting of orders, invoices and credit memos.

You can also change some servers settings in the new version without restarting the service.

You can have a different Company Name and Display name 

And Lots more

License Information

In order to run Microsoft Dynamics NAV 2018, you must have a valid Microsoft Dynamics NAV 2018 license file.  You will find more information about how to correctly license Microsoft Dynamics NAV 2018 in the license guide (partner-only).


Saturday, November 11, 2017

November 2017 Cumulative Updates for NAV 2013, 2013 R2, 2015, 2016 and 2017

Here are links to the release notes and download link for the CU's released.

NAV 2013 – Cumulative Update 56

You can download the cumulative update from KB 4052191

NAV 2013 R2 – Cumulative Update 49

You can download the cumulative update from KB 4052192

NAV 2015 – Cumulative Update 37

You can download the cumulative update from KB 4052193

NAV 2016 – Cumulative Update 25

You can download the cumulative update from KB 4052194

NAV 2017 – Cumulative Update 12

You can download the cumulative update from KB 4052195


Friday, October 20, 2017

Validate Email Address in NAV using RegEx


Last week I was working on a shipment notification project where I need to send Email Notification of the shipment and one thing we need to check is the email address is valid or not. In Standard NAV the SMTP mail codeunit or Mail Management codeunit has a function to checkValidEmailAddress but it does a very basic validation and it did not meet our needs so I have written a new function to validate the email address.

I have used  RegEx( Regular Expression) and According to Wikipedia

“A regular expression, regex or regexp[1] (sometimes called a rational expression)[2][3] is, in theoretical computer science and formal language theory, a sequence of characters that define a search pattern. Usually this pattern is then used by string searching algorithms for "find" or "find and replace" operations on strings.”

Since we have the access the functions of RegEx function using DotNet, I went a ahead and wrote the following function to validate the email address using RegEx.

In our case we could store multiple email addresses in a field, so I have used String Array to parse and validate the email address.

PROCEDURE ValidateEmailAddresses@1000000008(EmailAddresses@1000000000 : Text);
       RegEx@1000000004 : DotNet "'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Text.RegularExpressions.Regex";
       DotNetString@1000000003 : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String";
       EmailAddrArray@1000000002 : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Array";
       Convert@1000000001 : DotNet "'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Convert";
       I@1000000005 : Integer;
       EmailAddress@1000000006 : Text;
       EmailAddresses := CONVERTSTR(EmailAddresses,',',';');
       EmailAddresses := DELCHR(EmailAddresses,'<>');
       EmailAddrArray := RegEx.Split(EmailAddresses,';');
       FOR I := 1 TO EmailAddrArray.GetLength(0) DO BEGIN
         EmailAddress := EmailAddrArray.GetValue(I-1);
         IF NOT RegEx.IsMatch
               (EmailAddress,'^[\w!#$%&*+\-/=?\^_`{|}~]+(\.[\w!#$%&*+\-/=?\^_`{|}~]+)*@((([\-\w]+\.)+[a-zA-Z]{2,4})|(([0-9]{1,3}\.){3}[0-9]{1,3}))$') THEN
I got the above email address regular expression pattern from the below link, so please visit the below to know what validation it does.

If you have any other tips or suggestions , please do share them in the comments below.


Wednesday, October 18, 2017

How to Schedule NAV Services to Restart


Recently I was asked if there is a way to schedule a NAV service to restart at a specific time, and for that I have used a small PowerShell script which I have scheduled using windows task scheduler.

Below is the script and steps for that

This example is based on NAV 2013 but the same code can be used for other versions

The below  PowerShell script is used to restart NAV Services, since in our case there are more then one NAV instance on the server, I have used a for loop to find all the available/running instances and then filter those instances using like statement, in this case I am only restarting NAV Instances with the word “Test” in their name. You can replace this with any other word or remove that condition.

Import-Module 'C:\Program Files\Microsoft Dynamics NAV\70\Service\NavAdminTool.ps1' -WarningAction SilentlyContinue | Out-Null
$Instances = Get-NAVServerInstance
for ($i = 0; $i -le $Instances.Count - 1; $i++) {    
     if ($Instances[$i].State -eq 'Running' -And $Instances[$i].Name -like '*Test*') {       
         Restart-Service $Instances[$i].Name
         #Write-Output $Instances[$i].Name

Save the above script in a file and store in a location then we need to create a Task Scheduler to execute the above script.

Create a new task using the option shown in Fig 1, then choose the name, and Trigger when you want to run, under the Actions tab choose Start a Program  (Fig 2) and for the program use Powerhsell.exe and specify the ExecutionPolicy ByPass and path for the script in arguments


Fig 1


Fig 2


Fig 3

This will create a task in windows scheduler to restart the services, you can also export the task as .xml and import into another server.

If you have any other tips or suggestions, please do share them in the comments below.


Saturday, October 7, 2017

October 2017 Cumulative Updates for NAV 2013, 2013 R2, 2015, 2016 and 2017

Here are links to the release notes and download link for the CU's released.

NAV 2013 – Cumulative Update 55

You can download the cumulative update from KB 4045667 

NAV 2013 R2 – Cumulative Update 48

You can download the cumulative update from KB 4045668

NAV 2015 – Cumulative Update 36

You can download the cumulative update from KB 4045669

NAV 2016 – Cumulative Update 24

You can download the cumulative update from KB4045670

NAV 2017 – Cumulative Update 11

You can download the cumulative update from KB4045671


Friday, September 29, 2017

MAPI is not working properly while sending email in NAV

Recently I have worked on a issue related to E-mail, and would like to share the solution which helped me to resolve the issue.

One user is are getting the following error “MAPI is not working properly. One way to get MAPI working is to install Microsoft Exchange” when they try to send the email. This is version NAV 2009 R2, and in this version one way to send a report by email is using, File –> Send –> Report by Email. as show in Fig 1.

When I have searched the web I have found articles/forums where it was suggested to unregister MAPI OCX Dll File and Register it again, I have performed those steps but still it did not help to resolve the issue.


Fig 1.

One thing I did notice on that workstation was even though Outlook 2013 was installed it was never setup/initialized, once I have setup an account on outlook and then try to send the report by Email it opened the Outlook Client with Report body.

So, please make sure there is a default MAPI email client installed and setup when you receive the above error and that resolved the issue in my case.

If you have any other tips or suggestions to resolve this error, please do share them in the comments below.


Friday, September 22, 2017

How to print a remote file from NAV


I have seen couple of times the requirement where we need to print a document from NAV which is not a report, it could be a marketing campaign letter, sales sheets or any other document.

Most of the time we upload these kind of documents on a website/remote site, so if we need print those documents with every invoice or any other statement, below is the function you can use from NAV.

In the below example I just took a random PDF URL from the web and used it for testing.

The key in this function is to download the document from the web using WebClient locally and then use the Process to print the document to the printer.

LOCAL PROCEDURE PrintRemoteFile@1240060002();
       FileURL@1240060000 : Text;
       ProcessStartInfo@1240060001 : DotNet "'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.ProcessStartInfo";
       Process@1240060002 : DotNet "'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process";
       WebClient@1240060003 : DotNet "'System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.WebClient";
       LocalFileName@1240060004 : Text;
       FileURL := '';
       ProcessStartInfo := ProcessStartInfo.ProcessStartInfo();
       WebClient := WebClient.WebClient();
       LocalFileName := 'C:\Temp\TempFile.pdf';
       ProcessStartInfo.FileName := LocalFileName;
       ProcessStartInfo.Verb := 'Print';
       ProcessStartInfo.CreateNoWindow := FALSE;
       Process := Process.Process;
       Process := Process.Start(ProcessStartInfo);
       MESSAGE('Document Printed');

If you have any other tips or suggestions to resolve this error, please do share them in the comments below.