locked
This workflow job was canceled because the workflow that started it included an infinite loop. Correct it RRS feed

  • Question

  • Hi,

    I have a plugin registered on Update of "Total Amount" of Invoice Entity, When I am adding a product through "Invoice Product" subgrid, I am getting the error as "This workflow job was canceled because the workflow that started it included an infinite loop. Correct it".

    My plugin code is no where updating the Current Invoice Record.

    Thanks,

    Vijay



    • Edited by vijay59 Friday, October 17, 2014 8:30 AM
    Friday, October 17, 2014 8:20 AM

Answers

  • Thanks Divyesh,

    I have added "context.Depth>1" also then to its throwing error. So I though of Instead triggering the plugin on updating the "Total Amount" feild on Invoice. I've cahnged and registered the plugin on the Update of "Invoice Product " form. Its working now.

    Regards,

    Vijay

    • Marked as answer by vijay59 Tuesday, October 21, 2014 5:30 AM
    Tuesday, October 21, 2014 5:30 AM

All replies

  • PLease refer this,this and this.

    Also refer this.


    Regards, Saad


    • Edited by Mohd Saad Friday, October 17, 2014 10:07 AM
    Friday, October 17, 2014 10:04 AM
  • Thanks Saad,

    But the Plugin is registered on Update of two attributes. But for other attribute is working fine. But for this attribute its throwing this error. This attribute(Total Amount) automatically fills when the Invoice Product is added to the subgrid.

    Regards,

    Vijay

    Friday, October 17, 2014 11:12 AM
  • hi,

    Please add below code after the context.it stop the workflow after one depth.

    if (context.Depth > 1)
    return;

    Regards,

    Divyesh Sapovadiya

    Saturday, October 18, 2014 3:45 AM
  • Thanks Divyesh,

    I have added "context.Depth>1" also then to its throwing error. So I though of Instead triggering the plugin on updating the "Total Amount" feild on Invoice. I've cahnged and registered the plugin on the Update of "Invoice Product " form. Its working now.

    Regards,

    Vijay

    • Marked as answer by vijay59 Tuesday, October 21, 2014 5:30 AM
    Tuesday, October 21, 2014 5:30 AM