locked
CRM 2013: Workflow is triggered twice RRS feed

  • Question

  • Hello Everyone,

    We have a background workflow registered in Registration entity on Create and Update of Status field. It sends an email when status equals to "Send Email".

    Customer reported that, on change of the status to "Send Email", workflow has triggered twice and sent the email twice in Prod.

    We have a ribbon button in Registration entity which changes the status to "Send Email". When the record is created it will be in "Account Created" status. But we have a background process which also creates Registration record but directly with "Send Email" status. So, we have enabled the workflow for On create as well.

    We tried repro the same issue in Prod by creating a record with status "Account Created" and changed the status to "Send Email". It has triggered only once. But we could see in Email Messages, it was triggered twice for many records continuously. And also observed this problem only after the workflow is enabled on Create of a record. Can anyone please explain what could be the issue?

    Thank you,

    Nithya

    Thursday, March 17, 2016 1:32 PM

Answers

  • Hi,

    Able to find out the issue. Below is the reason.

    When user creates registration record with status “Account Created” and immediately change the status to “Send Email”, two workflows will be triggered, one for “Create” and one for “Update”. As it is an asynchronous workflow, by the time workflow triggers for “Create” event, the status is already changed to “Send Email”. So, both “Create” and “Update” event sends email which appeared as “Workflow triggered twice and sent email twice”

    Friday, March 18, 2016 11:25 AM

All replies

  • Hi

    Did you check if under processes you have same workflow twice ?

    This can happen, if you added workflow manually in test and prod env. and after that you moved a solution from test to prod which has the workflow included.

    Thursday, March 17, 2016 2:41 PM
  • Yes. It is having only one workflow. Also when I tried to repro the same issue in Prod by creating one Registration record and sent email. It triggered only once.
    Friday, March 18, 2016 4:23 AM
  • Hi,

    Able to find out the issue. Below is the reason.

    When user creates registration record with status “Account Created” and immediately change the status to “Send Email”, two workflows will be triggered, one for “Create” and one for “Update”. As it is an asynchronous workflow, by the time workflow triggers for “Create” event, the status is already changed to “Send Email”. So, both “Create” and “Update” event sends email which appeared as “Workflow triggered twice and sent email twice”

    Friday, March 18, 2016 11:25 AM