Sunday 14 August 2016

MS CRM error: 1 is not a valid status code for state code SalesOrderState

1 is not a valid status code for state code SalesOrderState.Submitted on salesorder with Id <Guid>


Error Code -2147187704

Today i face the error on while creation of sales order in Dynamics CRM online 2016. System wasn't letting the user create sales order and throwing a generic exception with message :

1 is not a valid status code for state code SalesOrderState.Submitted on salesorder with Id <Guid>

with error code: -2147187704.

This was pretty unusual because i know that 1 is a valid status code code for sales order.

After much research, the solution i found was then relatively easy. For the user the indicator "Integration Users Mode" in the user administration was switched to Yes. 

But the problem was this flag isn't usually displayed on the CRM user form.
So here i used little trick. I created a on demand workflow to set back the field to NO and run the on demand workflow on the user.  

After I put this flag back to No everything was working as per the expectations.

My observation is that recently the user had experimented with the CRM connectors to connect the CRMs with Navision, while the flag was changed by the Connector.


Hope it would be helpful.
Please comment if any better solution exist.

No comments:

Post a Comment