Monthly Archives: August 2011

Manually install xp_ndo

Sometimes you need to manually install the extended store procedures use by NAV Integrated Security.

  1. Copy the xp_ndo.dll file to the location you want store it. The file can be found under "D:\SQLDatabase\PFiles\Microsoft Dynamics NAV\60\Database" on the product DVD.
  2. Run the following SQL command to add the stored procedures.

USE master
EXEC sp_addextendedproc xp_ndo_enumusersids, 'C:\[Location of file]\xp_ndo.dll'
GO

GRANT EXECUTE
ON [xp_ndo_enumusersids]
TO PUBLIC
GO

USE master
EXEC sp_addextendedproc xp_ndo_enumusergroups, 'C:\ [Location of file]\xp_ndo.dll'
GO

GRANT EXECUTE
ON [xp_ndo_enumusergroups]
TO PUBLIC
GO

A Simple tool for Synchronising SQL Database Structures

Often you are working on an SQL project in a development environment that involves database changes. How do you ensure the structural changes (including stored procedures) are replicated to production?

There are various commercial tools, but I like to use DBDiff or SQL-DBDiff.

Enable and Disable Service Broker

ALTER DATABASE [NAV2009]

SET ENABLE_BROKER

--SET DISABLE_BROKER

WITH ROLLBACK IMMEDIATE

NAV2009 – An I/O exception occurred during the operation (1)

NAV instantiates some temp folders and files based upon the combination of User Name and NAV Service Tier (NST). These cannot be shared.

So if you attempt to login from two different machines as the same Windows user on the same NST, the error following message will appear

An I/O exception occurred during the operation

You'll need to either

  1. Create a second NST, which is easy, and connect to it
  2. Make sure you don't share user logins across multiple machines

Wrong Date and Time interpretation when using Dynamics NAV Web Services

The client Regional settings affect date and time interpretations within Dynamics NAV. The Region is easily set when using the Classic or Role Tailored Client (RTC). When using a Web Service its also easy, if you know how (like most things in life).

I have an application that takes Point-of-sale (POS) transactions from Advance Retail and passes them into Dynamics NAV. A problem arose where transactions for early one morning (say 6:00am 21st Jan 2011) where appearing in NAV with a Posting Date of the day before (20th Jan 2011). The problem was the client date time was based upon GMT +10 but the Web Service was working in UTC time.

The default Time Zone is UTC. -not very helpful when I live in Sydney Australia.

Settings within the client application making the Web Service call have no effect on the web service.

Within the CustomSettings.config file you'll find

 

In my case I want to use Australian Eastern Standard time.

Restart the web service and the Date and Time is now correctly interpreted.

Oh, and if you need the middle-tier (NST) to operate in different Time Zones, just run up another Web service. (see another post on how to do this)

Cube Calculations of Current Date, Month, Quarter and Year

If you've struggled like me to define BI reports that contain default values for the Year, Month, Date then the following cube calculations might help. Just use these calculations as the selection when the report is defined. Then each time you open the report you'll be referencing the current Year and Month and not the ones you selected when the report was defined.

CREATE MEMBER CURRENTCUBE.[Posting Period].[Date].[All].CurrentDate
AS STRTOMEMBER("[Posting Period].[Date].&[" + Format(now(), "yyyy-MM-dd")+ "T00:00:00]"),
VISIBLE = 1;

CREATE MEMBER CURRENTCUBE.[Posting Period].[Week].[All].CurrentWeek
AS STRTOMEMBER("[Posting Period].[Week].&[" + CSTR(DATEPART("ww",now())) + "]"),
VISIBLE = 1  ;

CREATE MEMBER CURRENTCUBE.[Posting Period].[Period].[All].CurrentMonth
AS STRTOMEMBER("[Posting Period].[Period].&[" + Format(now(), "MM")+ "]"),
VISIBLE = 1  ;

CREATE MEMBER CURRENTCUBE.[Posting Period].[Quarter Name].[All].CurrentQuarter
AS STRTOMEMBER("[Posting Period].[Quarter Name].&[Q" + CStr((int(month(now())-1)/3)+1) + "]"),
VISIBLE = 1  ;

CREATE MEMBER CURRENTCUBE.[Posting Period].[Year].[All].CurrentYear
AS STRTOMEMBER("[Posting Period].[Year].&[" + Format(now(), "yyyy")+ "]"),
VISIBLE = 1  ;

Adjust the Hierarhcy names like [Posting Period].[Period] [to suit your installation.

The above calculations assume your using a January - December time frame. If you aren't you'll need to replace

now()

With

DateAdd("m",x,now())

Where x is the month offset you need.

For example if you run a July - June year use

DateAdd("m",6,now())

A call to SSPI failed in NAV 2009 R2

It is not unusual for your network security guys to force regular password changes. What is unusual is that once you changed your password you can no longer run NAV RTC. And receive the obscure message

Equally frustrating is that NAV Classic still works.

You will also see Event Log errors like this one on the NAV Server Tier

What's happening is your connection details have been cached (without you realising)

You can remove this cache entry by running the command

rundll32.exe keymgr.dll, KRShowKeyMgr

And then deleting the connection that represents the NAV Service Tier

Can’t send BizTalk documents from NAV2009 Role Tailored Client

As a regular user in NAV2009R2, attempting to Send a BizTalk document resulted in the error message.

This message is for C/AL programmers: The call to member Send failed: The handle is invalid

But I could send if the user happened to be in the network Administrators group.

The solution turned out to be due to permissions to the folder

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys

Once I added read permissions to the user group "Everyone" I could send from NAV to BizTalk.

Looks like this folder is created by NAV but permissions are not inherited. I say this because other folders above and at the same level as MachineKeys had Read permissions for "Everyone"

As far as I can tell. The COM object being run by the NST needs to encrypt the message before it sends to the Commerce Gateway Requestor Service. Is was the encryption that was failing during the send.

CRM 2011 – NAV 2009 R2 Synchronisation – tips and tricks

The following pointers are little things we picked up while synchronising CRM 2011 and NAV 2009 R2, that were not well documented elsewhere. It doesn't cover everything - just the points that were poorly documented by Microsoft, or not obvious to us.

Firstly, make sure you have the right version installed. An early version of connector V5 caused errors when used with CRM 2011. To make sure you have the right version, go here: http://support.microsoft.com/default.aspx?scid=kb;en-US;2544388

CRM Users (perhaps only the integration user?) need to be set up as being in the same timezone as the NAV Server. If not, synchronisation will just never work. This needs to be done while logged in as the user, from the File>Options menu. You will need to do this for the integration user before you make it an integration user (you cant log in using that user after that).

Currency codes will probably cause a problem once you try to synchronise. This is covered in the connector documentation, by changing a mapping function. What it doesn't tell you is that you cant just copy and past the function in. I had to delete the current value, then user the function builder (from clicking on the paper and pen icon) to construct the function.

If you add a new field to NAV and wish to synchronise it, apart from updating config files (which is kind of straight forward), it also needs to be on the appropriate page, else it wont work.

Manually Create NAV Service Instances

In the default installation just one NAV Server Service and one NAV Business Web Service is created.

I have found that in real life you need more NAV Server Services, and then you can spread users across them. In one case I created 7 different instances.

Often the documentation suggests names like NAV2, NAV3.. I found it more useful to use names that identify the group of users.
This also makes it easier for users to know which Instance they are using.

Here is the syntax I use.

Create Service NAVAdmin

sc \\pandora-nav create MicrosoftDynamicsNAVServer$NAVAdmin binpath= "F:\Program Files\Microsoft Dynamics NAV\60\ServiceAdmin_WS\Microsoft.Dynamics.Nav.Server.exe $NAVAdmin" DisplayName= "Microsoft Dynamics NAV Server Admin" start= auto type= own depend= NetTcpPortSharing

Set the description of the service (otherwise it will be blank)

sc description MicrosoftDynamicsNAVServer$NAVAdmin "NAV Service used by Admin"

Create a Web Service

SC \\pandora-nav CREATE MicrosoftDynamicsNAVWS$Admin binpath= "F:\Program Files\Microsoft Dynamics NAV\60\ServiceAdmin_WS\Microsoft.Dynamics.Nav.Server.exe $Admin" DisplayName= "Microsoft Dynamics NAV Business WS" type= share

Set the description of the web service

sc description MicrosoftDynamicsNAVWS$Admin "NAV Web Service used by WS"

 

Cutom.config changes

<add key="ServerInstance" value="DynamicsNAVAdmin"></add>

See http://msdn.microsoft.com/en-us/library/dd301437.aspx for full details, particularly on setting up TCP Port Sharing


© Copyright 2010. Jigsaw Technology Pty Ltd. All rights reserved. | Privacy Policy | Site Map