locked
CRM2011: Plugin not triggered from workflow RRS feed

  • Question

  • Hi,

    I want to fire the plugin when an record been created, manually create the record is works properly, but if the record is created by workflow, the plugin will never be fired.

    Any idea why? How to solve the problem?

    Wednesday, February 22, 2012 8:41 AM

Answers

  • I find out finally, in my plugin I check "context.Depth", if depth > 1 then return, that's why it's not fired by workflow.


    • Marked as answer by nixjojo Thursday, February 23, 2012 7:38 AM
    Thursday, February 23, 2012 7:38 AM

All replies

  • There should not be any difference between for a plugin being triggered. How did you determine that the plugin is not running?

    Patrick Verbeeten
    www.patrickverbeeten.com
    www.wavextend.com

    Wednesday, February 22, 2012 11:26 AM
  • Check out whether your Workflow is working fine and creating the  entity record of which your plugin is registered 


    With Regards Athul MT If you find this answer as help ful please vote as helpful and if you find this answer Please Mark It as Answer :)


    • Edited by Athul MT Wednesday, February 22, 2012 11:33 AM
    Wednesday, February 22, 2012 11:33 AM
  • can you share your code where you call workflow?

    did you select start when on workflow?


    Software Specialist Crm


    Wednesday, February 22, 2012 11:56 AM
  • Try making your plugin step asynchronous and see if that triggers.

    Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav

    Wednesday, February 22, 2012 3:05 PM
  • I throw en exception when the plugin be fired, if I manually create the record, the exception throw out which means the plugin be fired, but the exception was not throw out if the record is create by workflow.

    Meanwhile, I put break point in the plugin and try to debug, only manually create record will go into the breakpoint.

    Thursday, February 23, 2012 2:02 AM
  • Yes, the workflow run successful, and the record created.
    Thursday, February 23, 2012 2:03 AM
  • I find out finally, in my plugin I check "context.Depth", if depth > 1 then return, that's why it's not fired by workflow.


    • Marked as answer by nixjojo Thursday, February 23, 2012 7:38 AM
    Thursday, February 23, 2012 7:38 AM
  • I find out finally, in my plugin I check "context.Depth", if depth > 1 then return, that's why it's not fired by workflow.


    its nice 2 hear it but if you try to explain your problem with details and share info( your code ) what u did we could find and solve the problem in a short time.


    Software Specialist Crm

    Thursday, February 23, 2012 7:45 AM