Decode the Error Codes in Dynamics CRM

Microsoft has done a fine job in documenting the web service error codes for all versions of CRM. The web service error codes for CRM 2013 can be found here.

The Error IDs documented on MSDN and CRM SDK are in hexadecimal format. For example, the error code ‘80040516’ translates to a ‘The opportunity cannot be closed’ error message. But when you encounter an error or an exception in your application, the error log displays the error ID in a decimal format. The same exception is displayed with an error code ‘-2147220202’. Searching for this error code on MSDN or CRM SDK may not fetch you the desired results.

What do you do next?

Open the Windows Calculator. Set the view to ‘Programmer’ (ALT + 3). Copy the decimal number and then select the ‘Hex’ option to convert it to a Hexadecimal number. The result displayed would be something like ‘FFFFFFFF80040516’. Strip the ‘FFFFFFFF’ and search SDK for the error code ‘80040516’. This will give you the required information on the error code.

Advertisements

One thought on “Decode the Error Codes in Dynamics CRM

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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