Connect to multiple NST with RTC

If you are in a situation where you are switching between different NST on daily basis and are getting tired on changed server from RTC every time, here is the solution. You can create different RTC configuration files per NST.

Step by step for windows 7
1. Copy the C:\Users\”user name”\AppData\Roaming\Microsoft\Microsoft Dynamics NAV\70\ClientUserSettings.config file to a directory you like
2. Update the newly copied configuration file
For example:
<add key=”Server” value=”[NSTSERVER]” />
<add key=”ServerInstance” value=”[second instance]” />
<add key=”ClientServicesPort” value=”7048″ />
3. Right click on the desktop and click on New->Shortcut
4. Brows to the installation directory for RTC. Example : “C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe”
5. Click Next
6. Change the name of the shortcut if needed
7. Click Finish
8. Find the newly created shortcut on the desktop and right click on it and pick properties
9. Update the “Target” to for example: “C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client\Microsoft.Dynamics.Nav.Client.exe” -settings:”C:\\.config“
10. Click Save
11. Now you can easly connect RTC to any NST you want by simple clicking on right shortcut.

Extra tips
If you want to add the shortcut to the start menu. Simply copy the newly created shortcut from the desktop to C:\Users\”user name”\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Moving to Dynamics CRM

After a bit more than 6 years the time have arrived to move away from Dynamics NAV. So from this week I have moved to product team Dynamics CRM. I may still write some more blogs about Dynamics NAV but don’t expect many more of them. I’m looking forward to this new challenges and I hop soon to start blogging about Dynamics CRM and my new projects.

Temporary table in NAV

I recently found a very interesting blog post about temporary tables by Vjekoslav Babic. It explains really good the different ways a temporary table is handled when used as a parameter . You can basically call a method with a table by value or by reference. When you are using by value the data in the table is copied to a new variable and when you are using by reference you are actual using the same variable as the calling method. This work as expected when not using temporary tables. When it comes to temporary tables you may get an unexpected behavior when using the “by reference”.

Here is an example
temporary table example

The “ByRefereceWrong” will actual delete all records if you are passing a none temporary record to it. A fixed version with verification can be found in “ByRefence” where we use record reference and the ISTEMPORARY method.

Vjekoslav blog post found here does cover some other problem areas as “phantom insert”. I would recommend reading the complete post.

Problem installing demo database

 Saurav did get before me in writing this blog post. Have you ever seen below error when installing the demo database.

Could not connect to the SQL database. (-2147467259 master ). This can be caused by insufficient permissions. Indirect permissions through Windows group memberships may not work as expected when User Account Control (UAC) is turned on.

Few resolutions to the problem
1) UAC is turned on.
2) SQL server is not running
3) Your user doesn’t have sufficient privileges on the SQL server.
4) Old database file are left on the system.

Take a look at Saurav’s blog for the solutions. Saurav’s blog post is found here

Every time when adding/deleting a user the NAV service shuts down

Recently I run into a problem where NAV service did shut down every time I did add or delete a user.

The event log explain the problem like bellow. So it obvious that we of some reason can’t connect to the database.
Type: System.Data.SqlClient.SqlException
Class: 14
LineNumber: 1
Number: 916
State: 1
Source: .Net SqlClient Data Provider
ErrorCode: -2146232060
Message: The server principal “XX\YY” is not able to access the database “ZZ” under the current security context.

When looking at the security for database “ZZ” I found the same problem as the event log was pointing at, no trace of user “XX\YY” with gives the NAV service access to the database. It turns out that when adding or deleting a NAV user all user privileges is re-synced, and any user not part of the new list is deleted. And if the NAV service account is not part of the user list, NAV service can’t longer connect to database.

The solution is very simple. You have to make sure that the service account is added as a user in NAV under Tools – Security – Windows Logins. Followed by syncing logins.

Silent or unattended installation on NAV

What is silent or unattended installation
Simply said silent install is installation without any UI. In this case it’s about how to run “setup.exe” in silent mode. It’s recommended that you only run “setup.exe” when you install a new NAV installation, because the installer have been tested by them using this procedure only. So by that said it’s no longer supported to install from the different msi files directly. This is true for all NAV 2009 releases. The major problem you may run into if you are installing directly from the msi files is that you will not get prerequisites (as .Net, Report Viewer and so on) installed and you will also miss out one some pre installs checks (validating that you have everything needed as outlook).

How to-do it?
It’s very simple. “setup.exe” does support some different parameters for this purpose:
/quiet <– will turn of the UI
/log [filename] <– create a log text file in the specified location
/config [filename]<– point to the configuration file to use during the installation
/uninstall <– will simple un install the product
/repair <– repairs a bad installation

Read more

Change listener connetion error

“The Microsoft Dynamics NAV Server cannot connect the Change Listener to SQL Server because of the following error: user ‘NT AUTHORITY\NETWORK SERVICE’ failed when log in”.

This error may happen when you are attaching the database manually, or if database and NAV service is on two different machines. A variation of this may also happen if you setup NAV server to user domain user account. Luckily the solution is the same for all problems

Enabling the Object Change Listener Read more

The “OK” button is greyed out on RTC server selection window

Did decide to write this blog since this simple problem did take a lot of time for me to find the solution for, in the hope that it will save you from the same time eater.

The problem I did run into was that when starting the RTC client it could not connect to the service, since I had moved the service. Since the service had moved I did say “no” to the questions if RTC should try to connect again. In the address field in the “server selection window” I did type the new address into address field. The “OK” button was now greyed out, so I could not connect to the server.

After spending some time to try to figure it out how to un grey the “OK” button I found by simple press TAB in the address field make RTC to connect to the service and retrieve the companies on the service. Now the “OK” button was not greyed out anymore.

Dynamics NAV RTC hangs when previewing/printing reports

When previewing a report you only getting a small window in upper left corner with only a text string with the name for the report and the rest blank. When I trying to close this window, you get an error message: “Errors exist. Do you want to discard changes?” (Y/N). Pressing Yes, hangs and close the RTC client.

Probably cause:
You have installed the RTC client outside the setup chainer or you have uninstalled Report Viewer 2008. It may also be that Report Viewer 2008 installation is broken.

Run DVDPrerequisite ComponentsMicrosoft Report Viewer 2008 ReportViewer2008.exe and select install or repair depending on if Report Viewer 2008 was already installed.

CREATE DATABASE failed when installing Cronus Sample Database

Today I did run into a problem installing the “Cronus Sample Database”. In the error report view I found this error message

SQL Server option

Cronus Sample Database for Microsoft Dynamics NAV 2009

Fatal error during installation.

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Read more

Next Page »