Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Is there any way to know if a MS CRM exception was thrown by a plugin?

As the title states, I'm looking for a way to tell the difference between an error caused by my code or basic CRM functionality and an error thrown by any custom plugin that may be installed on the clients system.

Something we continuously fall victim to is our clients custom third party plugins that either they created in house or bought from another ISV. They register it on a CRM entity we touch or even on one of our own entities in the most recent case. We try to do something, the plugin tries to do its thing and fails. In the most recent example, the plugin wasn't encoding a ' correctly after we put it into CRM. The plugin throws an error and CRM throws it back to us.

How can I tell that the plugin is the culprit without wasting hours investigating? So far I've only seen one company make it easy to tell by throwing the plugins stack trace as the error message.


  • I'm looking for a programmatic solution to cut down on the time it takes to identify the issue is a custom plugin and not our code interacting with their CRM from Azure.
  • I am attempting to enhance our error logging/handling to be smart enough to tell the difference.
  • Even if our code works 100% but triggers a synchronous plugin to fire and that plugin fails, we get an exception from CRM.
  • Everything we do is programmatic via the SDK.
like image 247
Justin williams Avatar asked Oct 05 '22 09:10

Justin williams

2 Answers

The only thing that comes to mind is to enable CRM tracing. The link below should explain how to do this in Microsoft Dynamics CRM.


like image 75
code4life Avatar answered Oct 17 '22 06:10


When there is an exception caused by a plugin as this picture: enter image description here

you can download the log file, inside you can easily find which plugin caused the exception, check for example this log:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: StupidPluginDetail: 
// ... other details
[StupidPlugin: StupidPlugin.ExamplePlugin]
[bda9ad85-c4a5-e211-bc00-78e7d162ee67: StupidPlugin.ExamplePlugin: Create of orderclose]
like image 38
Guido Preite Avatar answered Oct 17 '22 06:10

Guido Preite