CRM/NAV Connector – State Code or status code is invalid

I was getting the error above when trying to add an order in CRM

the reason I was getting this error because I was using the service user to try and add records into CRM 2011.  This won’t work because the service user can only create/modify records using the SDK.

This is a new edition to the Connector for Microsoft Dynamics, so watch out.

Also once you have set the service user you cannot unset him easily.  You can change this but I’m afraid you are moving into the realms of unsupported changes.

if you try to change the service user by running the CRM configuration utility again with a different user you will set up two users who can’t create orders and yes I did find this out the hard way.

Basically there is a field on the SystemUserBase table called IsIntegrationUser .

When a user is used to run the CRM config utility it will set this value to true and assign the user the Dynamic Integration security role.

To unset you a user you need to set the IsIntegrationUser field to false

as an alternative and much safer method you could show the field on the user form and then set the value on there.

Once you have done this you can then sign in as that user and start using CRM again.

This is all well documented in the installation guide but for those of you who haven’t read it for a while it’s well worth remembering.

Don’t use your CRM user to run the CRM config utility in the connector