How to turn on Logging for the Dynamic Connector

Sometimes you need to look at the logs of the connector because the initial error is not very descriptive and you need a few more clues.

The logs are held in an unusual folder – ProgramData, which is often hidden from browsing, so you often have to paste the folder into windows explorer.

below are the steps to start the logging and where to find the file.

You may have problems editing the Microsoft.Dynamics.Integration.Service.exe.config file and the way around this is to copy the file to another folder, make the change and then copy it back and overwrite the original.

You can get this log following these steps:

  1. Stop the Connector service
  2. Go to C:\ProgramData\Microsoft Dynamics\Connector for Microsoft Dynamics\Logs
  3. Rename the following file (new name is not important): Microsoft.Dynamics.Integration.Service.log
  4. Open the following file in Notepad: C:\Program Files (x86)\Microsoft Dynamics\Microsoft Dynamics Adapter\Microsoft.Dynamics.Integration.Service.exe.config
  5. Locate the following parameter: “Microsoft.Dynamics.Integration.TraceLog”
  6. Set the value for this parm to: 4
  7. Start the Connector service
  8. Reproduce the error
  9. read the log file C:\ProgramData\Microsoft Dynamics\Connector\Microsoft.Dynamics.Integration.Service.log
Advertisement

Dynamic Connector – Client Hanging when viewing log files

I had a frustrating few hours this morning when the Dynamic Connector client kept freezing, not responding before finally crashing.

I seemed to be getting the error when trying to view the log files for some of the maps.

I tried installing the Dynamic Connector on another server and I was getting the same error.

The solution to the problem (in my case) was fairly straight forward but logical.

 

deleting all of the Exceptions in the MapExecptions table in the MSDI database

I also deleted all the values from the Logs table as well (for good measure)

Then I re-launched the client and things were good again.

obviously be aware that if you delete the Logs table you won’t have any logs (but I can usually rack up a load pretty quickly)

Dynamic Connector – When new/custom tables won’t add web services

I have been working on a Dynamic Connector upgrade and one of the steps in the upgrade is you have to apply a hotfix.  These hotfix is for the Integration of Countries/Regions hotfix.

I think this was to fix a problem that occurred because in NAV you have a countries/region lookup and this basically just converted to a field in CRM.  sometimes this value was to big for the field in CRM.

So the hotfix meant changing the CodeUnit 5150 and adding in some lines to add the Countries/Regions.

I probably need to explain how (in my mind anyway) the Dynamic Connector works.  In NAV the Pages are used to create Web Services and these web services are used by the connector to read/write data to/from NAV.

When you tick the Enable Connector button in the Marketing Setup it kicks off the codeunit 5150 and this creates and publishes the web services   So when applying the new hotfix the code changes should have run when you ticked/unticked the enable connector button.  The changes should have added a new web service called Integration Countries/Regions.

You can see the web services by pasting the url from the adapter settings, with Services added onto the end

http://navserver:7047/customerName/WS/Services

or by opening NAV classic –>Administration–>IT ADministration–>General Setup–>Web Services

or by typing Web Services in NAV 2009/2013

Above you can see the Integration Countries/Regions has been added but the problem I was experiencing was after I made the changes to the code unit and unticked/ticked the enable connector button, it was adding in the new web service.

Something seemed to not be working because usually when you untick the enable connector button it clears all the web services.  One possible solution was that maybe someone else was logged onto NAV.

Anyway the way I got around this was to add the web services manually.

You can go to web services in NAV and add#

Object Type       Object ID       Service Name                                   Published
Page                     10                   Integration Countries/Regions      Yes

You will need to add the values above.  You will also need to add a row to the Integration Page Table (5150)

Service Name Source                     Table ID Page ID Published
Integration Countries/Regions      9             10     Yes 

If you then restart the NAV web services (just to make sure) You should be up and running.

You might sometimes experience a similar problem when adding in custom tables into the Connector

Dynamic Connector – Missing Icon

Sometimes you end up installing, uninstalling the Dynamic connector lots of times, especially in the bad old days where the connector would often forget your maps when you updated them.

Sometimes this can lead to the icon missing, I will also add they should create their own logo (BRAND IT)

I know it’s not a big deal and it’s really worthy of a blog post but it was really annoying me and it looked awful on a customer site.

if you click the change icon button it will pop up this path

%SystemRoot%\Installer\{99B04600-CB97-4A17-8175-AE7B17A52E82}\GPLogo

to find the icon you need to replace %SystemRoot% which is refers to the directory where you installed Windows.  Mine is C:\Windows but I guess you could be radical and named the drive something else (is that even possible!).  You should end up with something like this

C:\Windows\Installer\{99B04600-CB97-4A17-8175-AE7B17A52E82}\GPLogo

A word of warning you might not be able to just copy and paste the line above because your Dynamic Connector installation could have a different guid.  Although oddly I have two installations with the same guid (but on different machines).

[NAV Enumerated Values to Picklist] has encountered an error while processing key [Countries_Regions]. Sequence contains no matching element

If you get this error message in the NAV connector for the enumerated maps

[NAV Enumerated Values to Picklist] has encountered an error while processing key [Countries_Regions]. Sequence contains no matching element

This means you haven’t read the install documentation correctly (don’t ask how I know this!!) and you haven’t applied a hot fix.

Basically between version 1 and version 2 of the connector they added in a new map to the enumerated types, this was probably because I think the countries field used to cause problems when mapping, especially when a user would type in a massive long value.

You need to run through this hotfix

http://support.microsoft.com/kb/2721512

You basically add a few values to the integration code unit.

Dynamic Connector upgrade Gotcha

A quick blog post about a little gotcha I found with a recent Dynamic Connector upgrade.

I upgraded an existing Dynamic Connector configuration and everything seemed to go ok but when I looked at the maps I could see that when I clicked on some of the custom maps I had made it wasn’t showing them saying

“Object Does not exist” or something like that

and then the map is blank and you cannot see any of the fields.

The reason for this was because it had only loaded the default maps, I had to run the configuration utility and tick all the custom (non default) maps and then it turned out the maps were ok.

 

I frustrating thing I find with the Dynamic Connector is that every time I search for an error the only source of information I come to is this blog.  I wish more people would blog about the Connector and wish the Connector team would blog more about the connector and the problems that crop up.

Dynamic Connector works with CRM 2011 and NAV 2013

Good news the Dynamic Connector or the Connector for Microsoft Dynamics team are keeping up the good work and development on the Dynamic Connector and already have it working with NAV 2013.

I will first add I think the Connector team need to use a better name than Connector for Microsoft Dynamics because that name makes it very difficult to search for help and we need all the help we can get when using the Dynamic Connector.

The way I search for things is type the name of the software and then the question but the name they are using makes it impossible and extremely difficult to find any help.

on a positive note I think the Dynamic Connector (I’m sticking with that name now) have put a lot more effort and development this year.

  • they have written more useful blog posts
  • put videos on the blog showing how to upgrade
  • improved the functionality (filtering)
  • fixed a load of bugs in the connector

but you still have some way to go because I upgraded the connector the other week and it totally fell apart and couldn’t read half of the maps and I still haven’t installed the connector without problems.

Dynamic Connector – Web service connection errors

A few weeks ago I was getting errors connecting to the NAV webservices using the Connector.

You can read more about that here

https://crmbusiness.wordpress.com/2012/08/16/crm-2011-dynamic-connector-error-the-request-failed-with-http-status-401-unauthorized/

I got round the problem by using the ip address of the server, other things you can try is the full name (usually .local at the end or something like that) or just the server or localhost if you are on the machine.

I did raise the question with the Dynamic Connector development team, who are a helpful bunch.

I have had a problem like this before and I thought I would explain what is causing this problem because you may come up agaisn’t similar issues like this in CRM, NAV and the Dynamic Connector.

The basic problem is Kerberos authentication and it’s failing.

the way I understand it is you can access the NAV webservices/crm webservices within internet explorer because you can add the webservices as a trusted site.   Adding this into the trusted sites helps the kerboros authentication, which explains why you can often access it using internet explorer.

If you can’t get any other url’s (ip address, localhost, servername, full servername) then you are going to have look at the SPN settings (Service Principal Settings).

If like me you are not sure what a SPN is, this is probably the time you start to talking to the IT experts internally and on the customer site.

I found a quick explanation about what an SPN is here

http://msdn.microsoft.com/en-us/library/windows/desktop/ms677949(v=vs.85).aspx

A service principal name (SPN) is the name by which a client uniquely identifies an instance of a service. If you install multiple instances of a service on computers throughout a forest, each instance must have its own SPN. A given service instance can have multiple SPNs if there are multiple names that clients might use for authentication. For example, an SPN always includes the name of the host computer on which the service instance is running, so a service instance might register an SPN for each name or alias of its host. For more information about SPN format and composing a unique SPN, see Name Formats for Unique SPNs.

Before the Kerberos authentication service can use an SPN to authenticate a service, the SPN must be registered on the account object that the service instance uses to log on. A given SPN can be registered on only one account. For Win32 services, a service installer specifies the logon account when an instance of the service is installed. The installer then composes the SPNs and writes them as a property of the account object in Active Directory Domain Services. If the logon account of a service instance changes, the SPNs must be re-registered under the new account. For more information, see How a Service Registers its SPNs.

When a client wants to connect to a service, it locates an instance of the service, composes an SPN for that instance, connects to the service, and presents the SPN for the service to authenticate. For more information, see How Clients Compose a Service’s SPN.

 

My basic understanding of this is you are setting up exe’s and computers to be trusted and put into a sort of list, so when a connection is attempted e.g. from the connector to a computer then if it’s on the list the kerboros authentication works.  Now my explanation could be a load of nonsense buts that how I imagine it works.

This issues are always tricky to resolve because often the IT staff won’t want to get involved and say it’s a problem with NAV/CRM/Dynamic Connector and it’s nothing to do with the IT setup.  It’s highly likely you won’t have access to the domain controller to be able to tinker with the SPN settings so you haven’t really got any choice but to keep explaining to the IT staff.

I have had days wasted trying to figure out these kind of problems and I hope your connector installations don’t suffer from this problem.

 

CRM 2011 – Dynamic Connector Error – The request failed with HTTP status 401: unauthorized

I was once again wrestling with a Dynamic Connector install.

The hardest thing about using the Dynamic Connector is as soon as you get an error, it’s practically impossible to find any help for it, I think this is due to not much has been written, they didn’t agree on a name for ages so you can’t prefix your search with something distinctive (e.g. connector is too ambiguous).

It’s quite frustrating when you searching for help and I keep getting diverted to my own blog, which didn’t have the answer (come on Hosk sort that out| what do you think I am doing right now)

The problem was trying to connect to the NAV Webservices.  I had enabled the connector webservices inside NAV (marketing, enable connector) and I had started the webservice and I could even connect to the web service using internet explorer but as soon as I tried to connect to the webservice inside of the connector I was getting an unauthorized error.

 

 

I checked the user I was using was  a domain user, they were an admin on the machine (not needed but a good sign I thought), they had the super role in NAV.  The user had all the credentials, so why was it throwing this message.

I changed the url I was typing to try

server name

localhost

full server with .local on it

 

none of the above worked.

What finally worked was to put in the ipaddress and then it worked without any problems.

I have to admit I don’t understand why this works and the others don’t but I have some vague idea it’s a security setting, possibly related to SPN but I’m not sure and I don’t really know how the web services in NAV work (what web server are they hosted in?)

Whilst searching for the problem I also found these articles which might be useful

how to turn on logging

http://community.dynamics.com/product/nav/navtechnical/b/navrenegayerblog/archive/2011/06/09/nav-crm-connector-just-one-more-tip-trace-log.aspx

Interesting forum discussion with other possible solutions

http://social.microsoft.com/Forums/hi-IN/crmdevelopment/thread/43aa5d1a-3326-4349-a183-881c76e7b0ce

 

 

Dynamic Connector – mapping OptionStrings in NAV to Optionsets in CRM

Firstly the article post below by the connector team was extremely useful, even if it took me a while to understand where they were putting the values because they didn’t have any screen shots.  I hope the connector team write some more blog posts because the Dynamic Connector users need all the help and documentation we can get.  The article below is exactly the kind of information which should be in a manual or wiki or at least written about a year ago and is the type of information which should be shared to help people get up and running with the connector.  whilst I am asking for the things, top of the list should be for the Dynamic Connector to have it’s own forum or if it has tell me about it.

http://blogs.msdn.com/b/dynamicsconnector/archive/2012/04/24/mapping-nav-optionstrings-and-crm-optionsets.aspx

Below shows my adventure mapping an OptionString in NAV to an OptionSet in CRM, which is harder than it sounds.

Field in NAV

Correspondence Type

*Blank*

Hard Copy

E-Mail

Fax

 

 

I created a new field in CRM called

NAV Correspondence Type

*blank*

Hard_Copy

E_Mail

Fax

So as we can see they basically have the same values

For the Contact to NAV Contact Card below is the code I had to put in.  basically a blank is shown in NAV as “_blank_”, so if the optionSet was blank in CRM (e.g. “”) I would put “_blank_”.  For some reason the values came through from NAV with an underscore e.g. Hard_Copy.

=If(EqualTo(NAV Correspondence Type\Name, “”), “_blank_”, NAV Correspondence Type\Name)

 

Going the other way – NAV Contact Card to Contact

The NAV Correspondence Type is hidden down the bottom.  It has a name and a value but we only want to use Name because we don’t have any way to match the values.

For this code I check to see if it’s “_blank_” and if it is just pass nothing “” otherwise we copy the name value across

 =If(EqualTo(Correspondence Type, “_blank_”), “”, Correspondence Type)

I also wanted to map a two options field in CRM to a checkbox in NAV.

In CRM the values are true and false and in NAV the values are Yes and No, they are close but not close enough to automatically map.  I have a feeling there could be an easier way to do this but I couldn’t find any dynamic examples, only hard coding examples.

NAV field

Exclude from Segment

CRM

CRM Exclude from Segment

 

The contact to NAV contact is shown on a picture above but here is the code

=If(EqualTo(CRM Exclude From Segment, “true”), “Yes”, “No”)

 

NAV Contact to Contact

=If(EqualTo(Exclude from Segment, “Yes”), true, false)