locked
How to Disable Plugin while Bulk Import RRS feed

  • Question

  • Hi all,
    Hi have audit log plugin which logs all the read, update , delete and updated records.
    But during bulk import it make asyncornous service very busy thus hitting the performance.
    I want that plugin should be automatically disable during bulk import .
    Please help
    Dare to promise
    Friday, August 7, 2009 9:28 AM

Answers

  • The bulk import is not a true bulk import and uses the same execution path when you create a new entity through the UI or CrmService. Once you register a plugin on the create message it gets fired when you import using CRM import facility.

    The only option is to unregister the step through code and reregister when the operation finishes. During that stage you won’t be able to audit non bulk import operations so it’s good practice to do it after or before working hours.

     

    About the retrieve message firing more than once. I can acknowledge that this is how CRM behaves. It’s not a bug but the way things are / system operates. This is probably due the internal retrieve that CRM does while executing other messages. If you take a closer look at the sequence of events you’ll probably notice that the retrieve does not fire 3 times consecutively but only after other messages fire e.g. retrieve -> update -> retrieve.

     

    Also, there isn’t any easy way of following / passing information between retrieves so you’ll probably end up accepting the current execution path or writing your own event tracker (not sure if this is a good idea for auditing)


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    • Marked as answer by D-Virdi Monday, August 10, 2009 8:35 AM
    Monday, August 10, 2009 7:06 AM

All replies

  • How many records are you importing?
    Friday, August 7, 2009 1:34 PM
  • HI Wael,
    Its in thousands.... :-(

    and one more bug in my code is it logs a record three times when I use retrieve message to save whos has ssen what.
    I dnt knw why it is so?
    Dare to promise
    Friday, August 7, 2009 2:32 PM
  • Anybody knows how to disable plugin during bulk import automatically
    Dare to promise
    Monday, August 10, 2009 6:09 AM
  • The bulk import is not a true bulk import and uses the same execution path when you create a new entity through the UI or CrmService. Once you register a plugin on the create message it gets fired when you import using CRM import facility.

    The only option is to unregister the step through code and reregister when the operation finishes. During that stage you won’t be able to audit non bulk import operations so it’s good practice to do it after or before working hours.

     

    About the retrieve message firing more than once. I can acknowledge that this is how CRM behaves. It’s not a bug but the way things are / system operates. This is probably due the internal retrieve that CRM does while executing other messages. If you take a closer look at the sequence of events you’ll probably notice that the retrieve does not fire 3 times consecutively but only after other messages fire e.g. retrieve -> update -> retrieve.

     

    Also, there isn’t any easy way of following / passing information between retrieves so you’ll probably end up accepting the current execution path or writing your own event tracker (not sure if this is a good idea for auditing)


    Blog: http://mscrm4ever.blogspot.com/ * Website: http://gicrm.upsite.co.il/
    • Marked as answer by D-Virdi Monday, August 10, 2009 8:35 AM
    Monday, August 10, 2009 7:06 AM