Tuesday, December 5, 2017

Configure Visual Studio Code with Dynamics NAV 2018 (Local Server Installation)

After installing Dynamics NAV 2018 I want to configure Visual Studio Code with Dynamics NAV to use new Development tool

I already had Visual Studio Code installed on my computer (Click to download Visual Studio Code) so I open up the application.

Do not follow Section 01 steps because you will run into issues. Read the Section 02 of the instructions to get it work.

Section 01 :

First thing I want to do is download AL Extention. In order to download AL extension follow below steps:

  1. Go to View Menu and click on Extensions. 
  2. Search for AL 
  3. Click Install


Once the Extention installation is complete I followed below steps:

  1. Press Alt+A, Alt+L to trigger the Go! command, 
  2. Choose "Your own server"
  3. Once you select the "Your own server" you will see a code like below in the "launch.json" file. 


I change the settings as below :


  "version": "0.2.0",  
   "configurations": [  
     {  
                "type": "al",  
                "request": "launch",  
                "name": "Local server",  
                "server": "http://localhost:7049",  
                "serverInstance": "DynamicsNAV110",  
                "tenant": "default",  
                "authentication": "Windows",  
                "startupObjectId": 22  
     }  
   ]  


Once I do that I got an error message, and I could not resolve it. (Could not download symbols. Please see the Visual Studio output log for more details)



Then I thought it is something to do with the Service tier config so I open up the config file and notice that "Enable loading application symbol reference at service startup" is disabled. I enabled it and restart the instance.



Even after that also I could not get to download symbols. Therefore I thought to use a different approach.

Section 02: 

I thought to install AL extension manually by using VSIX file.

  1. Uninstall AL extention from Visual Studio Code.
  2. Click View -> Extention.
  3. Click on ... to open the extension menu.
  4. Click on Install from VSIX



You can find VSIX file on the installation medium path: "ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment" or in the "C:\Program Files (x86)\Microsoft Dynamics NAV\110\Modern Development Environment"


This will install AL Language Version 0.12.15355

Once the Extention installation is complete I follow below steps

  1. Press Alt+A, Alt+L to trigger the Go! command.
  2. Choose "Your own server"
  3. Once you select the "Your own server" you will see a code like below in the "launch.json" file. 


   "version": "0.2.0",  
   "configurations": [  
     {  
       "type": "al",  
       "request": "launch",  
       "name": "Your own server",  
       "server": "http://localhost",  
       "serverInstance": "nav",  
       "authentication": "UserPassword",  
       "startupObjectId": 22  
     }  
   ]  

In my local installation, I use Windows Authentication and my NAV instance is different. Therefore I change the file values as below.

    "version": "0.2.0",  
   "configurations": [  
     {  
       "type": "al",  
       "request": "launch",  
       "name": "Your own server",  
       "server": "http://localhost",  
       "serverInstance": "DynamicsNAV110",  
       "authentication": "Windows",  
       "startupObjectId": 22  
     }  
   ]  

Once I update the values and save the file, it successfully downloads the symbols.

Please let me know if you use a different approach or if it workes with online extension installation for you.

Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara

Install Dynamics NAV 2018 with Modern Development Environment

Microsoft released Microsoft Dynamics NAV 2018 a few days ago and by now most of you have already downloaded the setup. If you don't have it already, you can download it by clicking here.

In this blog post, I will not go through each step as it is not much different with the installation process compared to previous versions. I want to highlight few new things which most people will not notice during the installation process.


In most of the time, I use the Customize installation option as it allows me to select individual components I want to install. In this instance, also I select the Customize option.

If you want to work with new development tool (to develop extensions) you want to enable "Modern Development Environment". By default, it is enabled and you do not have to do anything. If you not planning to work with new development tool then you can remove it from installation.



In the very next step, you will find another 2 new fields (it is growing by each version)
which are related to new Developer tool. 
  • Field 1: "Developer Service Port"
  • Field 2: "Developer Service Enabled"
You can ignore these two fields but if you planning to work with Modern Development Environment then I suggest you set it up correctly on the first go.

Developer Service is disabled by default, so you need to enable it (YES)



Once you pass the above step, everything is similar to previous version installation.

If you have already installed Microsoft Dynamics NAV 2018 without enabling the "Developer Service" then you can go to Dynamics NAV instance and change the settings (Restart instance after the changes)



Or

If you like to use PowerShell to change the port numbers (Try to make it a habit to use PowerShell as much as possible) you can use cmdlet

 Set-NAVServerConfiguration <InstanceName> -KeyName 'DeveloperServicesPort' -KeyValue <PortNumber>  
 Set-NAVServerInstance <InstanceName>-Restart -Verbose  

Good luck!!

Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara

Friday, December 1, 2017

Welcome to Microsoft Dynamics NAV 2018

The long wait is finally over. Microsoft Dynamics NAV 2018 is now available for download. 



You can now download Dynamics NAV 2018 by clicking here

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Monday, October 16, 2017

Check Dynamics NAV license from RTC

In order to check the current uploaded Microsoft Dynamics NAV License from RTC environment please follow below steps. 

01. Open RTC Environment.
02. Click on the white arrow in the top left corner of the client. (Refer below image)
03. Go to Help - > click on "About Microsoft Dynamics NAV"


04. "About Microsoft Dynamics NAV" window will have basic information about the license. Such as Product version and to whom the product is licensed to. 

05. In order to get more details click on the link "View your license information". It will open up a detailed license information page. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

New Release Date of Dynamics NAV 2018 and future of Dynamics NAV

It is a good news for all the Microsoft Dynamics NAV partners and for new customers who were waiting for Dynamics NAV 2018 on-premise version. 

The release date of Dynamics NAV 2018:
The wait is finally over and Marko Perisic announced in Madrid last week that we will have the published Dynamics NAV 2018 on December 1st. 

Dynamics NAV 2018 and VS Code Extension v2:
Dynamics NAV 2018 will allow partners to use Visual Studio Code for Extensions v2. This will allow partners to get ready for new Dynamics NAV 2018 R2 version which will be released in spring of 2018.

Same code two names: 
Dynamics NAV 2018 R2 and Dynamics 365 "Tenerife" will have the same codebase even though the names are totally different to each other which might change in near future. 

Rebranding:
Microsoft is thinking of rebranding Microsoft Dynamics NAV. Therefore most probably in future, we will not have the name "Dynamics NAV", but we will still have the powerful product. Future is bright for Dynamics NAV (let's just call it like that for now).


Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara

Tuesday, July 25, 2017

Value '-1' is not a valid value. The following values can be used >=0.

Hi,

Recently one of my colleague was trying to copy "Chart Of Account" to "IC Chart of Account" in NAV 2017 using default "Copy from Chart of Account" functionality. 

This is a really nice functionality available because within a single button click all the accounts in "Chart of Accounts" get copied to "IC Chart of Accounts".

Copying the accounts went smoothly as expected but once the copying finished screen changes to below. 

We first thought it was a refresh issue and just tried to refresh the page, but end up with below error message.
"Value '-1' is not a valid value. The following values can be used >=0."



We open up the IC GL account table and check for indentation and found that "End-Total" has a value of -1. The error went away once we change it back to 0 in the table.


So what went wrong? 

The first point to check was "Chart of Account" indentation and it was all OK. All set to 0. 




To understand what went wrong we open up the Page 605 and went to the "CopyFromChartOfAccounts" function. 

As highlighted in below for every "End-Total", program -1 from the current indentation value. Since "Chart of Account" indentation is set to 0, end-values in "IC Chart of Account" end up with -1. 

This built-in logic is totally acceptable if the Indent "Chart of Account" is done as below. 

Once the "Indent Chart of Accounts" is done, "Copy from Chart of Accounts" worked like a charm.

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Saturday, April 29, 2017

Internal error 52033 in module 93

Hi, 

During last week I was upgrading a 4.0 DB to NAV 2017. While opening the database from Microsoft Dynamics Classic Client, I got below error message. 

---------------------------
Microsoft Business Solutions-Navision
---------------------------
Internal error 52033 in module 93. 
Contact your dealer if you need assistance.
---------------------------
OK   
---------------------------

In order to resolve the error, you need to add T4616 to SQL Server Startup Parameter list. Please do follow below steps,

1. Open SQL Server Configuration Manager.
2. Select MSSQLServer Properties.
3. Navigate to Advanced Tab.
4. Select the Start up Parameter.
5. Navigate to End of the line and add String ;-T4616 as shown below.


Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Friday, March 31, 2017

Quick Fix : OLE control or Automation server identified by GUID-{F9043C85-F6F2-101A-A3C9-08002B2F49FB} not found

If you are working with a version of Microsoft Dynamics NAV, then most probably you might be familiar with below error message. 


This message is for C/AL Programmers:
Could not create an instance of the OLE control or Automation server identified by GUID-{F9043C85-F6F2-101A-A3C9-08002B2F49FB}.
Check that the OLE control or Automation server is correctly installed and registered.
GUID always helps to find the root cause for the issue. (Google GUID and you will get list of solutions)

In this case GUID {F9043C85-F6F2-101A-A3C9-08002B2F49FB} refers to the "Microsoft Common Dialog Control, v6.0". 

This normally get installed and placed in below folder path : "C:\WINDOWS\System32\comdlg32.ocx' and C:\Windows\SysWOW64\comdlg32.ocx"

Fix:
  • Download "comdlg32.ocx" from here.
  • Copy downloaded file to below two folder path
    • C:\Windows\System32
    • C:\Windows\SysWOW64 
  • Run command prompt in administrator mode (Run as administrator)
  • Run below two commands in command prompt to register comdlg32.ocx
  • 1:  regsvr32 c:\Windows\system32\comdlg32.ocx  
    2:  regsvr32 c:\Windows\SysWOW64\comdlg32.ocx  
    
  • After each command you will get individual confirmation messages. 
Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Quick Fix : There is no system code page on your computer that matches the code page of the collation for the database.

If you are still using a old version of Dynamics NAV or if you are trying to upgrade old version to a newer version of Dynamics NAV, then you might have a chance of getting below error message when you open up the database from Classic Client. 
---------------------------Microsoft Dynamics NAV Classic---------------------------
There is no system code page on your computer that matches the 850 code page of the SQL_Latin1_General_CP850_CI_AS collation for the XXXXXXXXXXXXXXXX database.
Your system code pages are: ANSI: 1252, OEM: 437.
Ensure that the Regional Options of the computer use the correct system language and locale for the code pages to match.
You can also disable the 'Validate Collation' setting for this database. It is possible that certain text data will not be converted correctly when stored in the database.
Click OK to disable the 'Validate Collation' setting and continue to use the database, or click Cancel to exit.
---------------------------OK Cancel ---------------------------
This error us due to your DB collations is different from your computer collation. You can have a quick fix to resolve this error however you might need to talk to your system and DB admin for a permanent solution. 

Quick Fix:

You need to change registry value in your computer to required Code page. In order to do that,

1. Press Start + R : To open Run Window
2. Enter "regedit" and click OK to open "Registry Editor"
3. Navigate to below path and find the OEMCP
4. Double click on the OEMCP and change Value Data to 850.


 [HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \Nls \Codepage] OEMCP = "850" (Default = 437)  

5. Restart Your computer to update registries. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Sunday, March 12, 2017

Quick Fix : Visual Studio displaying NAV Report Layout as XML

I got this issue with Visual Studio 2015 Enterprise Edition. 

Every time I open a Dynamics NAV report layout in Visual Studio, RDLC is rendered as XML file instead of visual layout with all the fields and tool boxes. 

How the report layout looks: 

FIX : In order to fix the issue you need to install "Microsoft SQL Server Data Tools"

To install "Microsoft SQL Server Data Tools" you need to go to 
Control Panel  -> Programs and Features - > Microsoft Visual Studio <Edition> -> Change

Or you can re run the installation setup. 
From the features list, enable "Microsoft SQL Server Data Tools" option and proceed. 
Once the installation is completed you are good to go. This time report layout will open in correct design layout. 
Hope this helps you to resolve the issue. happy designing. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Saturday, March 11, 2017

Best Practice - SQL Script

Hi,

This blog post is about one small best practice that can save lot of time in the long run if you are working with SQL Server Management Studio. 

Many people who involved in Dynamics NAV does not have a very close relationship with SQL Server Management Studio even though back-end of NAV is totally based on SQL DB. 

Even during that very little usage of SQL Server Management Studio, many people (including me) use wizards to do things because it's more easy and error free most of the time. 

Just like below, few clicks and we are almost there.. 


If we making backup (as an example) of same database for 10 times, then that mean we need to go through the same process over and over 10 times. 

Is there way we can do all those in one simple click? 

This blog post is about that. How about we create a small script in other word SQL Query which will do the same process for us. 

If you are not an expert in  SQL then you can use wizard to build your query. Do all the steps you usually do and then stop just before you press OK. 

Click on Script button and save it on a file or open in a new query window. 

If you open up in a new query window, your query will look like this and you can change the parameters as you want and just press execute. it will do the job for you.
 
Beauty of this method is that you do not have to go through wizard to get your task done, you can just do that with a click of a button. Think about time you going to save in long run. 

Other advantage is if you are doing a time consuming process then SQL Management Studio will show you the progress of your process in text format. 

I should give credit and thankful to SQL expert, my colleague Tomasz Szypilo who pushed me to use SQL scripts. 

Thank you for reading and hope you learned something from the blog post. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Friday, February 3, 2017

Understanding COMMIT and transaction scope with temporary records within Microsoft Dynamics NAV

If you did not went through the previous post on "Understanding COMMIT and Transaction Scope within Microsoft Dynamics NAV",  I suggest you to go through it before start reading this blog post. 


What do you think about temporary records and transaction scopes?  

Most of developers think temporary records are managed as transactions, but it's not

Even if you call COMMIT within the code, it does not respect the effect of it. Also if error occurred during the process then, system will not rollback the changes. Any change made to temporary table will have to roll back manually (should handle through code). 

It is simple. Just keep in mind that use of temporary tables makes life easy, also it can worse things too if you do not handle them with care. 

Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Thursday, February 2, 2017

Use of Virtual Table : Date - Microsoft Dynamics NAV

This blog post is about something powerful but hidden within Microsoft Dynamics NAV. I believe many developers always work with dates over and over during their day-today life and i'm sure many of you have done many functions which convert, split and do all sort of things with date.

Saying that many developers does not know the virtual table "Date" in Dynamics NAV. In this blog post I am going to briefly explain about the different options you can have with the Date table.

As per the demonstrate purpose I quickly create a page (Source : Date Table) and open it. Table has 5 columns which are

  • Period Type 
  • Period Start Date 
  • Period End Date 
  • Period No. 
  • Period Name 
Period Type :
Period Type has 5 different options which are,

  1. Date 
  2. Week 
  3. Month 
  4. Quarter 
  5. Year 
Other four (04) columns have different use depending on the Period Type. Let me go through each Period Type and explain the use of other 4 columns.


Date
I applied Date as a filter to "Period Type" column and check below page on how the data get filtered.

Period Start : Date which you have selected
Period End : Date which you have selected
Period No. : Integer value of the day within a week (1 - Monday, 2 - Tuesday)
Period Name : Name of the date which you have selected

In this level this make not much sense as this can be done quickly using small C/AL code.
Let's check on our next option.

Week
I applied Week as a filter to "Period Type" column and check below page on how the data get filtered.

Period Start : Date which you have selected
Period End : Date which the week ends
Period No. : which No. of week of the year (First week of the year is 1 and then it gets increase per week.)
Period Name : Same information as Period No.

Let's check on our next option.

Month
I applied Month as a filter to "Period Type" column and check below page on how the data get filtered.

Period Start : Date which you have selected
Period End : Date which the month ends
Period No. : Month in integer (1 - January, 2 - February) 
Period Name : Name of the month

Quarter
I applied Quarter as a filter to "Period Type" column and check below page on how the data get filtered.

Period Start : Date which you have selected
Period End : Date which the quarter ends
Period No. : Quarter No. in integer 
Period Name : Name of the month

Year
I applied Year as a filter to "Period Type" column and check below page on how the data get filtered.

Period Start : Date which you have selected
Period End : Date which the year ends
Period No. : Year
Period Name : Same information as 

Practical Use
Let's think you have a date and you want to know the start date of the week which your date falls in. You can do it by using different ways, but this is how quickly you can do that using Date record variable :

 Date.SETRANGE("Period Start",0D,YourDate);  
 Date.SETRANGE("Period Type",Date."Period Type"::Week);  
 IF Date.FINDLAST THEN  
  PeriodStart := Date."Period Start";  

That is it, that is all the code you need to write in order to make it work. I will keep other options to your imagination and to your creativity.

Credit of this blog post goes to : Craig Barberini for bringing this back to my memory.

Please provide your feedback with a comment.
Thank you and Regards,
Tharanga Chandrasekara

Sunday, January 29, 2017

January 2017 Cumulative Updates for Microsoft Dynamics NAV

Note :

***************************************************************************************************
  • Due to a change in the CRM SDK implemented in December 2016, customers in multi-tenant NAV environments with CRM Integration enabled may find that CRM syncing is disabled or fails intermittently. 
  • Affected versions include NAV 2016 CU14, NAV 2016 CU 15, NAV 2017 CU1 and NAV 2017 CU2.
  • Any multi-tenant environments on an affected version using CRM integration should implement NAV 2016 CU 15.1 or NAV 2017 CU 2.1 as soon as possible as a precautionary measure.
  • Customers on Dynamics 365 for Financials do not need to take any action; this issue has been corrected in all available versions.
  • NAV 2016 CU 15.1 and NAV 2017 CU 2.1 will be released as soon as possible.
***************************************************************************************************
Please provide your feedback with a comment. 
Thank you and Regards,
Tharanga Chandrasekara

Integrate Dynamics NAV 2017 with Dynamics CRM Online

This blog post contain step wise guide on how to integrate Dynamics NAV 2017 with Dynamics CRM Online (Dynamics 365). 

If you like to create a temporary test CRM account, please follow below steps in the gif. 

Make a note of Dynamics CRM URL and user account details in a separate notepad. These details will required at the later stage of configuration. 
01. Once the CRM account is in place you need to import the Dynamics NAV integration solution to CRM. 
A.Import Solution
  • Step 01. In order to do that you need to go to Settings of CRM.
  • Step 02. Click on the "Solution" to open up the solution window of Dynamics CRM

B. Click on the import button to import the solution
  • Step 01. Click on the Import button on the Solution window to open up the import wizard
C. Select solution from the import solution wizard 
  • Step 01. Click on "Choose File" option and select the file. (Following is the folder path : NAV2017 Build 10.0.14199 CU 1 W1\New folder\CrmCustomization)
  • Step 02. Once the solution is selected click on Next

 D. Check on the solution details and confirm 
  • Step 01. If the solution details are correct click on Next

E.Check on import options
Step 01. If you want to enable anyh SDK messages proceswsing steps include in the solution then tick the check box. 
Step 02. Click on Import

F. Solution will start to import to Dynamic CRM. 

G. Check for any errors and if there is need to correct those.
Step 01. Click on Close after checking the details of imported solution. 

H. Imported solution will be list down in the All Solution view of the Dynamics CRM.

Once the solution import is complete in the Dynamics CRM, now we need to setup Dynamics NAV for integration. 
02. Setting up Dynamics NAV
A. In order to config Dynamics NAV you need to navigate to CRM Connection setup page. 
  • Step 01. Navigate to "Department -> Administration -> IT Administration -> Services -> Microsoft Dynamic CRM Connection Setup"


B. Option 01. Enter the details and test connection 
  • Step 01. Enter the Dynamics CRM URL which you noted down  in notepad after creating CRM instance. 
  • Step 02. Enter CRM login account Name
  • Step 03. Enter CRM login account password
  • Step 04. Click on "Test Connection" to test the connection details 

If the connection details are correct then it will show below message. 


B. Option 02.
If you are using the Dynamics NAV 2017 version you have an new option which will help to setup Dynamics CRM connector. This assisted setup is a wizard which will take you through all the main steps to complete the setup. 
  • Step 01. Click on "Assisted Setup" and go through the steps to complete setup.

C.Enable CRM Connection
  • Step 01. Click on Enable check box to enable CRM Connection
Once the connection is enable it will show scheduled jobs which liked with Dynamics CRM.





 D. Setup Dynamics NAV Web service URLs. If URLs are not setup by yet you need to manually add the URLs to setup or you can use "Reset Web Client URL" option available. 
  • Step 01. If URLs are not setup then Click on the "Resent Web Client URL" option. It will populate required URLs into the setup. 


Once the above steps is completed, CRM connection is almost done. (Using default configurations). If you required to change the synchronization data flow direction, tables, fields then it required additional steps. Which we will discuss in a later blog post.