Tuesday, January 17, 2017

You do not have access to Microsoft Dynamics NAV

spanish-761512_1920

image

Most of us must have seen this error when we try to login into NAV, the reason for this error is the user who is logging into NAV does not have access to the database or the user is not setup in NAV RTC.

To fix the above error, you need to setup the user in NAV.  All the steps to create a new user is in the below Url.

https://msdn.microsoft.com/en-us/library/dd355093(v=nav.80).aspx

In another scenario when you have multiple databases and when the user is trying to login into a database, where the user is already setup as user in one of the database but he gets the above error and NAV client closes when he clicks OK.

Let’s assume we have two databases in this scenario TEST and PRODUCTION.

The user who is trying to login, has access to the TEST database but he does not have access to the PRODUCTION database, so in this case the error is valid since the NAV is trying to login into PRODUCTION database by default. But the real issue is NAV does not provide a way to login into TEST database, as it shuts down when you click OK. 

By default which database to connect is stored in a config file called ClientUserSettings.Config file.

In this case to fix the error ,the user need to update the ClientUserSettings.Config file and change the server and server instance key values to point to the TEST database.

The path for the ClientUserSettings.Config file is

C:\Users\<username>\AppData\Local\Microsoft\Microsoft Dynamics NAV

You need to change the below three key values and make sure they point to the TEST Server Instance.

<add key="Server" value="localhost" />
<add key="ServerInstance" value="DynamicsNAV" />
<add key="ServerPort" value="7076" />

Once you change and restart the NAV client it will open it successfully, given that user is setup properly.

Please leave your comments, feedback or any suggestions you have for me to improve my blog and also if you have any questions, feel free to post.

Share:

Wednesday, January 11, 2017

Open Xml Error on preview or print of a report in NAV

printer-98527


Recently I was trying to print a report in NAV 2017 Demo Database, and I have encountered the below error. The same error occurred even on preview of the report.


image


The default report layout setup for the report is set to word , so it is trying to preview or print a word format report . So to answer why does it it need an OpenXml component to print or preview is

In order to generate a word document of the report, the data output of the report which is in XML Format will be transformed by using the .NET Framework components such as Open XML SDK 2.5. Since it is missing that component on my computer, it is giving that warning. Usually you need to install those component on the NAV Server to avoid this error.

There is a nice article on the NAV community blog which explains the whole execution process of a report with different layouts, please check the blog on the below link for more information.

https://blogs.msdn.microsoft.com/nav/2014/10/30/report-execution-insights/

Solution : To fix the above error you need to install OpenXML SDK from the NAV DVD folder Prerequisite Components, once you install the components please restart the services and you will be able to preview or print the report.

Please leave your comments, feedback or any suggestions you have for me to improve my blog and also if you have any questions, feel free to post.

Share:

Tuesday, January 10, 2017

Cumulative Update 46 for Microsoft Dynamics NAV 2013 (Build 47667)

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

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 http://support.microsoft.com/contactus/.

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

  • AU – Australia
  • AT – Austria
  • BE – Belgium
  • CH – Switzerland
  • DE – Germany
  • DK – Denmark
  • ES – Spain
  • FI – Finland
  • FR – France
  • IS – Iceland
  • IT – Italy
  • NA – North America
  • NL – Netherlands
  • NO – Norway
  • NZ – New Zealand
  • SE – Sweden
  • UK – United Kingdom

Where to find Cumulative Update 46

You can download the cumulative update from KB 3216196  – Cumulative Update 46 for Microsoft Dynamics NAV 2013 (Build 47667).

Warning

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.

Additional Information

For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013.

For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

CustomerSource:

PartnerSource:

Share:

Cumulative Update 39 for Microsoft Dynamics NAV 2013 R2 (Build 47662)

Cumulative Update 39 includes all application and platform hotfixes and regulatory features that have been released for Microsoft Dynamics NAV 2013 R2.

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 http://support.microsoft.com/contactus/.

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

  •   AU – Australia
  •   AT – Austria
  •   BE – Belgium
  •   CH – Switzerland
  •   CZ – Czech Republic
  •   DE – Germany
  •   DK – Denmark
  •   ES – Spain
  •   FI  – Finland
  •   FR – France
  •   IS – Iceland
  •   IT – Italy
  •   NA – North America
  •   NL – Netherlands
  •   NO – Norway
  •   NZ – New Zealand
  •   RU – Russia
  •   SE – Sweden
  •   UK – United Kingdom

Note: Implementing this cumulative update will require a database upgrade.

Where to find Cumulative Update 39

You can download the cumulative update from KB 3216194  – Cumulative Update 39 for Microsoft Dynamics NAV 2013 R2 (Build 47662).

Warning

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.

Additional Information

For more information about cumulative updates for this version, see Announcement of update rollups for Microsoft Dynamics NAV 2013 R2.

For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2013 R2.

For a list of all hotfixes included in cumulative updates for this version, see the following CustomerSource and PartnerSource pages:

CustomerSource:

PartnerSource

Share:

Cumulative Update 27 for Microsoft Dynamics NAV 2015 (Build 47665)

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

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 http://support.microsoft.com/contactus/.

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

  •   AU – Australia
  •   AT – Austria
  •   BE – Belgium
  •   CH – Switzerland
  •   CZ – Czech Republic
  •   DE – Germany
  •   DK – Denmark
  •   ES – Spain
  •   FI  – Finland
  •   FR – France
  •   IS – Iceland
  •   IT – Italy
  •   NA – North America
  •   NL – Netherlands
  •   NO – Norway
  •   NZ – New Zealand
  •   RU – Russia
  •   SE – Sweden
  •   UK – United Kingdom

Note: You must convert the database if you are upgrading to this cumulative update from a cumulative update earlier than Cumulative Update 9 (build 41779). For more information, see Converting a Database in Help for Microsoft Dynamics NAV.

Where to find Cumulative Update 27

You can download the cumulative update from KB 3216192  – Cumulative Update 27 for Microsoft Dynamics NAV 2015 (Build 47665).

Warning

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.

Additional Information

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

For information about how to work around a recent process change, see How to Get Back the ‘Hotfix Directories’ from NAV 2015 Cumulative Update 1.

For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2015.

Share:

Cumulative Update 15 for Microsoft Dynamics NAV 2016 (Build 47671)

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

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 http://support.microsoft.com/contactus/.

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

  •   AU – Australia
  •   AT – Austria
  •   BE – Belgium
  •   CH – Switzerland
  •   CZ – Czech Republic
  •   DE – Germany
  •   DK – Denmark
  •   ES – Spain
  •   FI  – Finland
  •   FR – France
  •   IS – Iceland
  •   IT – Italy
  •   NA – North America
  •   NL – Netherlands
  •   NO – Norway
  •   NZ – New Zealand
  •   RU – Russia
  •   SE – Sweden
  •   UK – United Kingdom

Where to find Cumulative Update 15

You can download the cumulative update from KB 3216191 – Cumulative Update 15 for Microsoft Dynamics NAV 2016 (Build 47671).

Warning

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.

Additional Information

For information about how to install the cumulative update, see How to Install a Microsoft Dynamics NAV 2016 Cumulative Update.
Note that if you upgrade to this cumulative update from a version older than Microsoft Dynamics NAV 2016 Cumulative Update 6, you must run the development environment with elevated rights (run as administrator).

For a list of all cumulative updates for this version, see Released Cumulative Updates for Microsoft Dynamics NAV 2016.

Share:

Wednesday, January 4, 2017

How to upload files to FTP server using .NET Interop

upload-1118929

In my previous posts i have explained how to download the files from the FTP Server or  move the files from one folder to another on the FTP server. Here are the posts if you have missed them

How to download files from FTP server using .NET Interop

How to move files from one folder to another on FTP server.

In this post i will show you the code i have used to upload the files to the FTP server.   The FTPSetup is a Setup table which I have used to store the path, ftp server, user, and password information.

In the first function (UploadFilesToFTP) I have used an Array to store the paths of all the files from the upload directory, then I iterate through the array and execute second function to upload the file. In the second function it uses FTP Web Request method ‘STOR’ to upload the file to the server.


LOCAL PROCEDURE UploadFilesToFTP@1240060030();
     VAR
       FTPWebRequest@1240060000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebRequest";
       FTPWebResponse@1240060001 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebResponse";
       NetworkCredential@1240060002 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.NetworkCredential";
       WebRequestMethods@1240060003 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.WebRequestMethods+File";
       UTF8Encoding@1240060004 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Text.UTF8Encoding";
       ResponseStream@1240060005 : InStream;
       FileStream@1240060006 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.FileStream";
       TempBlob@1240060008 : TEMPORARY Record 99008535;
       FileName@1240060007 : Text;
       OutStream@1240060009 : OutStream;
       SearchOption@1240060013 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.SearchOption" RUNONCLIENT;
       ArrayHelper@1240060012 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Array" RUNONCLIENT;
       ArrayLength@1240060011 : Integer;
       DirectoryHelper@1240060014 : DotNet "'mscorlib'.System.IO.Directory" RUNONCLIENT;
       i@1240060015 : Integer;
       RelativeServerPath@1240060016 : Text;
       ClientFilePath@1240060017 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String" RUNONCLIENT;
       PathHelper@1240060010 : DotNet "'mscorlib'.System.IO.Path";
     BEGIN
       GetFTPSetup;
       ArrayHelper := DirectoryHelper.GetFiles(FTPSetup."FTP Local Upload FilePath",'*.txt',SearchOption.TopDirectoryOnly);

      ArrayLength := ArrayHelper.GetLength(0);

      IF ArrayLength = 0 THEN
         EXIT;

      FOR i := 1 TO ArrayLength DO BEGIN
         RelativeServerPath := FORMAT(ArrayHelper.GetValue(i - 1));
          UploadFileToFTP(RelativeServerPath);
       END;
     END;

    LOCAL PROCEDURE UploadFileToFTP@1240060031(FileToUpload@1240060018 : Text);
     VAR
       FTPWebRequest@1240060000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebRequest";
       FTPWebResponse@1240060001 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebResponse";
       NetworkCredential@1240060002 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.NetworkCredential";
       WebRequestMethods@1240060003 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.WebRequestMethods+File";
       UTF8Encoding@1240060004 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Text.UTF8Encoding";
       ResponseStream@1240060005 : InStream;
       FileStream@1240060006 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.FileStream";
      Stream@1240060020 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.Stream";
       FileDotNet@1240060019 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.File";
       TempBlob@1240060008 : TEMPORARY Record 99008535;
       FileName@1240060007 : Text;
       OutStream@1240060009 : OutStream;
       SearchOption@1240060013 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.SearchOption" RUNONCLIENT;
        i@1240060015 : Integer;
       RelativeServerPath@1240060016 : Text;
       ClientFilePath@1240060017 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String" RUNONCLIENT;
       PathHelper@1240060010 : DotNet "'mscorlib'.System.IO.Path";
     BEGIN
       GetFTPSetup;
       FTPWebRequest := FTPWebRequest.Create(FTPSetup."FTP Local Upload FilePath" + PathHelper.GetFileName(FileToUpload));
       FTPWebRequest.Credentials := NetworkCredential.NetworkCredential(FTPSetup."FTP UserName",FTPSetup."FTP Password");
       FTPWebRequest.UseBinary := TRUE;
       FTPWebRequest.UsePassive := TRUE;
       FTPWebRequest.KeepAlive := TRUE;
       FTPWebRequest.Method := 'STOR';

      FileStream := FileDotNet.OpenRead(FileToUpload);
       Stream := FTPWebRequest.GetRequestStream();
       FileStream.CopyTo(Stream);
       Stream.Close;

      FTPWebResponse := FTPWebRequest.GetResponse();
       FTPWebResponse.Close();
     END;

Please leave your comments, feedback or any suggestions you have for me to improve my blog and also if you have any questions, feel free to post.

Share:

Monday, January 2, 2017

How to move a file from one folder to another on FTP Server

move-1015582_1920

To move a file from one folder to another we normally using System.IO.File functions Move or Copy but in this scenario these functions will not work on FTP server. To achieve this on FTP we need to use FTP web request methods and below is the code i have used for that.

For your reference please check my previous post for downloading files from the FTP Server How to download files from FTP server.

The function is very simple. The tricky part over here is what method to use on FTP WebRequest to move the file, the method we have to use is ‘RENAME’ and using RenameTo  property to specify the file path.

[TryFunction]
LOCAL PROCEDURE MoveFileFromConcurFTPToArchive@1240060038(FileToDownload@1240060010 : Text);
VAR
  FTPWebRequest@1240060000 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebRequest";
  FTPWebResponse@1240060001 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.FtpWebResponse";
  NetworkCredential@1240060002 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.NetworkCredential";
  WebRequestMethods@1240060003 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.WebRequestMethods+File";
  ResponseStream@1240060005 : InStream;
  FileStream@1240060006 : DotNet "'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.FileStream";
  FileName@1240060007 : Text;
BEGIN
  GetFTPSetup;
  FTPWebRequest := FTPWebRequest.Create(FTPSetup."FTP Download FilePath" + FileToDownload);
  FTPWebRequest.Credentials := NetworkCredential.NetworkCredential(FTPSetup."FTP UserName",FTPSetup."FTP Password");
  FTPWebRequest.UseBinary := TRUE;
  FTPWebRequest.UsePassive := TRUE;
  FTPWebRequest.KeepAlive := TRUE;
  FTPWebRequest.Method := 'RENAME';
  FTPWebRequest.RenameTo := 'archive/' + FileToDownload;
  FTPWebResponse := FTPWebRequest.GetResponse();
END;

I hope this will save time for others who are looking for a solution.

Please leave your comments, feedback or any suggestions you have for me to improve my blog and also if you have any questions, feel free to post.

Share: