NAV/CRM Dynamics Connector – Error – Object reference not set to an instance of an object

I got this error today

NAV/CRM Dynamics Connector – Object reference not set to an instance of an object

this was very frustrating because I hadn’t changed anything, literately tried to turn on the connector to make some changes.

I’m not sure what had happened but the connector had got itself into a right mess.  I tried to repair it and it couldn’t write any values to the MSDI database.

It was complaining about the user privileges but the user had admin rights on the machine and the database.

I tried uninstalling and reinstalling but this didn’t work at all because then the service was appearing in the list of services, the database was still dodgy.

In the end to resolve this problem I had to delete the MSDI database in SQL Server management studio.

What I surmise was the problem was the database had for some reason become corrupted and if you don’t delete the database I think it still leaves it there to use, so when I reinstalled the connector it was still using (or trying to) the corrupted database.

I did find a couple of other blog posts which put forward different answers but they seemed like more effort than deleting and starting again (make sure you back up those maps)

but I will paste them below if you need to try them

this one seems quite promising but it didn’t work for me


One thought on “NAV/CRM Dynamics Connector – Error – Object reference not set to an instance of an object

  1. Konstantin December 30, 2011 / 3:28 pm

    Hi Ben,
    I described only one case with this error.
    Here is many different ways to down your connector with the same error …
    For example, you have custom entity and you updated CRM settings in Connector twice. After that you will two adapters:
    ProjectObjectProvider – from first update
    and new_projectObjectProvider – from second update

    If you not delete second adapter and not reopen your client after update but create new map with Project entity, you will notice that during creation in Entites list you have two Project entites.
    If you choose wrong one, related with second provider, and create new map, after restarting client you’ll get same error message about “Object reference” but resolving this issue will be much more complex than I described in my blog. In this case you have to cleanup your maps in connector, delete adapter and delete all related with this entity record in MSDI.Maps, not just records with Null.

    In general, to avoid this issue in future, just keep in mind couple things:
    – ALWAYS delete second adapter (it has prefix for custom and lowercase and sometimes different name for standard entites) and reopen Client right after update CRM setings in Connector.
    – Always make sure that your map and adapter was created/generated in the same integration (they both have MetadataID and it mast be the same, if not, you will get “Object reference error”)

    Happy New Year


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s