locked
Workflow that fires when Quote.TotalAmount is updated gets an Infinite loop error RRS feed

  • Question

  • I have a workflow that updates a custom field on the Quote entity when the Quote Total amount is updated. When the workflow is executed the below error occurs.

    “This workflow job was canceled because the workflow that started it included an infinite loop. Correct the workflow logic and try again. For information about workflow logic, see Help.”

    To reproduce this error, create an on demand work flow that has an update step. The update step sets the quotes deposit to 100. Execute the Workflow, then navigate to the Process Sessions area of the workflow. You will see the work flow has been executed numerous times. If you open a process session record you will see the error mentioned above.

    I assume this occurs because when the quote is updated the total amount is re calculated, when the total amount is re calculated then workflow is executed, when the work flow is execute the quote is update and when the quote is update the total amount is update and so on and so on and son.

    For Example

    1. Quote Is Update

    2. Total Amount is re calculated

    3. Work flow is triggered and updates quote deposit.
    4. Total Amount is re calculated
    5. Work flow is triggered and updates quote deposit.
    6. Total Amount is re calculated
    7. Work flow is triggered and updates quote deposit.
    8. Total Amount is re calculated
    9. Work flow is triggered and updates quote deposit.
    10. Error Occurs

    I hope this makes sense

    Does anyone know or have any ideas on how to solve this?

    Friday, August 14, 2015 4:51 AM

All replies

  • Hello,

    I'm afraid that there is no customization-way to fix your issue. Development way:

    1. Develop plugin which will contain exact the same logic with possibility to analyze Depth of call i.e. avoid infinite loop.

    2. Develop custom workflow activity that will return depth of workflow call and include it into workflow. That will provide possibility to stop workflow on some predefined depth.


    Dynamics CRM MVP
    My blog

    Friday, August 14, 2015 5:26 AM
    Moderator
  • Thanks for your help?

    Does that mean the total amount is re calculated every time a quote is updated?

    Friday, August 14, 2015 5:40 AM
  • Seems that this happens. And if it happens - that means that it is either bug or normal behavior. Anyway the only company who can help you with explantion why it works as it works is Microsoft.

    Dynamics CRM MVP
    My blog

    Friday, August 14, 2015 5:56 AM
    Moderator
  • Any thoughts on how I can determine if this is an issue, by design or not true?

    Friday, August 14, 2015 6:10 AM
  • As a possible option to check - create test instance of CRM and implement your scenario. If it would be reproduced - it is by design and only MS could help you wil this issue. If not - this issue is related to your particular deployment and you will have to check what's wrong with it.

    Dynamics CRM MVP
    My blog

    Friday, August 14, 2015 7:18 AM
    Moderator