Debugging · Dynamics CRM 2011 · Dynamics CRM 4.0 · Plugin · Workaround

Plugin does not run during Data Import

Encountered this issue today, data is imported, but Plugin did not run for any of the records. The Plugin runs when creating record using CRM UI or SDK Call.

Well, the cause is that if you check for context.Depth in your plugin code, the Async job that executes the import will cause the depth at the first plugin pipeline to be 2.

So the solution is just to ignore context.Depth check during data import and all will be fine.

Cheers – Sy

Advertisements

4 thoughts on “Plugin does not run during Data Import

  1. Also with on premise environments sometimes you might include external dlls sometimes in the \Microsoft Dynamics CRM\CRMWeb\bin.
    This will cause issues for any asynchronous calls you make so the best thing is to alsways merge your dlls.

    Thanks for the post!

    1. Hi Rob, thanks for the comment. What do you use to merge your dlls? I have been interested in it for a while, but have not tried any tools. Sy

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