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

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 to Rob Hufschmitt Cancel reply