How do I find out what fired plugin in CRM 2013? (workwlof, external application, crm forms and so on) RRS feed

  • Question

  • Good morning, 

    I would like to know how I can find out in execution code of plugin what fired this plugin in crm 2013. (if workflow, external application, crm forms and so on). 

    This code (call CallerOriginHelper class) do not work in CRM 2013 - http://a33ik.blogspot.fr/2012/06/callerorigin-in-plugins.html

    (Plugin fired from worklow is type=Application  of enum CallerOrigin).

    Is there any technique, how I can find out what fired plugin?


    Tuesday, September 30, 2014 6:05 AM

All replies

  • There is no reliable way to do this in CRM 2013. There are some ways you can try to get this:

    1. Get the HttpContext - I think this is still possible in Crm 2013, but not in Crm Online
    2. Use the approach in the link you posted (again not possible in Crm Online, and may not work in Crm 2013)
    3. If you are concerned with identifying a particular source, you could add a dummy attribute and only pass a value in this attribute from the particular source, then access this via the Target InputParameter. This only works for Create and Update messages, but does work in Crm Online

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    • Proposed as answer by Guido PreiteMVP Tuesday, September 30, 2014 9:59 AM
    Tuesday, September 30, 2014 9:53 AM
  • This link shows some code that will capture all plugin context information.  You can use this to update a Trace Log.
    Tuesday, September 30, 2014 8:25 PM