Greetings guys, I have a requirement that has to do with field service and I've met a really strange situation.
My client wants a .doc file to generate and attached to a bookable resource booking every time that its field "booking's status" turns to "Completed". For that I used a workflow with a SetWordTemplate action, and it works great. The status turns to "Completed" and voila a single .doc file is generated and attaches to the booking. Perfect.
Now, I have to say that besides that workflow, the field "booking status" update triggers a (synchronous) plugin as well. Moreover we have several plugins running on updates of different fields of the booking other than the status (let's say that one of them is the field "Return Time"). When the user fills the "Return Time" field with a value, sets the booking status to "completed" and saves the entity, two plugins are running on the background. It takes some time but they do their work as planned. However, to my unwelcome surprise, when they complete, there are several identical.doc files attached to the booking. The worfklow is supposed to run only once though, and it seems the delay of the plugins run have caused the flow to run multiple times. Now if I update only the "Return Time" field and save, then update the booking status to complete and save, only one .doc is generated. Any idea why is this happening and how I can face it?
PS: The plugins do not update the field booking status somewhere, there's no loop.
You mention the word flow in you description Is it s Flow or a Workflow? (a flow would trigger on any update)
Look at the audit history to see if there are multiple updates showing the field in question (your plugins may have an update transaction that includes the field in question as part of the transaction even though the value does not change it would still trigger as an update on the field as the field is part of the update).
You may need to implement a flag or date field that you update to indicate that the process has already run and then check that field in your flow/workflow.
Hi,
Can you please check if your plugins perform an update directely on the target entity.
You can also play with the execution order. In fact, you can avoid simultaneous executions between your plugins.
The delay is not the problem.
Hi Giannis
I have experienced similar issues when workflows run asynchronously. My general approach for this problem is to trigger the workflow/process in a plugin, because in plugins you can explicitly check if the state has changed to completed for the current event by inspecting both the preimage and the changing fields
While this does mean the process is not entirely configurable in the UI, it means less chance of missed or duplicate executions of the process
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102