locked
Can plugin be fired on update of event programmatically without making changes in the MSCRM frontend? RRS feed

  • Question

  • Hi,

    I wanted to know if there is any way to call plugin code programatically if we update a record by using the entity class?

    Do plugins get fired only if we update a record from the MSCRM frontend interface?This is in case a plugin is registered on teh update of a entity.

    Tuesday, December 18, 2012 5:08 AM

Answers

  • Hi,

    Your Plugins will fire only when you will use MS CRM Apis or service to update records and also if you have used filtered attributes while registering plugin, then plugin will fire inly those specific attributes changed. so for example you have one console application and you are calling update method for some entity and you have update plugin registered for that entity, it will fire.

    HTH


    Contact Me
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    • Proposed as answer by MubasherSharif Tuesday, December 18, 2012 7:12 AM
    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:44 AM
    Tuesday, December 18, 2012 6:25 AM
    Moderator
  • YEs CRM007,

    Your plugin would work in both the cases , when ever you update the field the plugin would triger wether u r updating in database or on form . I would explain you the same in diff scenario: I have a Plugin which would be trigered on "Create" message. In my Scenario i am not creating the record in form, i am impoarting the record using Xcel sheet, My Plugin Trigered in the both cases, even when i create in form or directly importing the records. Hope this helps

    Regards

    Nandan

    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:45 AM
    Tuesday, December 18, 2012 5:32 AM
  • While you are updating any record directly in database no events fires so plugin will not fire. In order to fire plugin you have to use crm plartform or crm services. 
    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:44 AM
    Tuesday, December 18, 2012 5:59 AM

All replies

  • Hi,

    Plug-ins are event handlers. They execute in response to a particular event being fired by the platform. It will fire in both the case.

    Tuesday, December 18, 2012 5:21 AM
  • What if i update a field by using update query in the database and i have registered a plugin on the update of that particular field of the entity?will the plugin work?
    Tuesday, December 18, 2012 5:27 AM
  • YEs CRM007,

    Your plugin would work in both the cases , when ever you update the field the plugin would triger wether u r updating in database or on form . I would explain you the same in diff scenario: I have a Plugin which would be trigered on "Create" message. In my Scenario i am not creating the record in form, i am impoarting the record using Xcel sheet, My Plugin Trigered in the both cases, even when i create in form or directly importing the records. Hope this helps

    Regards

    Nandan

    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:45 AM
    Tuesday, December 18, 2012 5:32 AM
  • I have called my plugin on the update of campaign activity.Only on the update of two particular fields.When i update them from the backend,my plugin does not fire.

    If i do the same from the frontend ,it works..


    • Edited by CRM007 Tuesday, December 18, 2012 5:37 AM
    Tuesday, December 18, 2012 5:36 AM
  • While you are updating any record directly in database no events fires so plugin will not fire. In order to fire plugin you have to use crm plartform or crm services. 
    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:44 AM
    Tuesday, December 18, 2012 5:59 AM
  • Hi,

    Your Plugins will fire only when you will use MS CRM Apis or service to update records and also if you have used filtered attributes while registering plugin, then plugin will fire inly those specific attributes changed. so for example you have one console application and you are calling update method for some entity and you have update plugin registered for that entity, it will fire.

    HTH


    Contact Me
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    • Proposed as answer by MubasherSharif Tuesday, December 18, 2012 7:12 AM
    • Marked as answer by CRM007 Tuesday, December 18, 2012 7:44 AM
    Tuesday, December 18, 2012 6:25 AM
    Moderator