locked
Multiple triggers for a plug-in RRS feed

  • Question

  • Hi,

    When there are 100 users trying to trigger a particular plug-in at the same time, how many times the plug-in will execute and which user action will be triggered??

    For example:

    If a serial number (custom attribute) is generated by the above plug-in for any entity record, what will be the output and process of exection in the above scenario?

    Thanks,

    Srinivas.K
    Tuesday, July 31, 2012 3:49 PM

Answers

  • Hi Srinivas,

    The plugin will execute independently each time it is triggered, so it will trigger 100 times in your example. There is no coupling between pipeline executions other than that all stages other than Pre-Validation run within a 'read committed' database transaction. If you want to create a serial number that is an unique auto number, you need to adopt a locking strategy by either using an external lock, or utilising CRM's transactional pipelines. A very good example of this is http://crm2011autonumber.codeplex.com/

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, July 31, 2012 4:08 PM
    Answerer

All replies

  • The last one to execute wins. However, if you are assigning a serial number, it would make more sense to trigger on create only. That way, it will only be triggered once per record, even if multiple users update the record at the same time after. There is no conflict resolution in CRM, it is always the "last one wins" rule.

    Gonzalo | gonzaloruizcrm.blogspot.com

    Tuesday, July 31, 2012 4:07 PM
    Moderator
  • Hi Srinivas,

    The plugin will execute independently each time it is triggered, so it will trigger 100 times in your example. There is no coupling between pipeline executions other than that all stages other than Pre-Validation run within a 'read committed' database transaction. If you want to create a serial number that is an unique auto number, you need to adopt a locking strategy by either using an external lock, or utilising CRM's transactional pipelines. A very good example of this is http://crm2011autonumber.codeplex.com/

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, July 31, 2012 4:08 PM
    Answerer