https://connect.microsoft.com/dynamicssuggestions/feedback/details/777281/ur-12-auto-save-feature-causing-workflows-plugins-to-be-triggered-multiple-timesHi all,
UR 12 has introduced a nice feature called “Auto Save” which will save the CRM Records(only Process Driven UIs) in the background automatically when it get updated by the user in UI.
When a field value changed by user, in the bottom right corner a label as “Unsaved Changes” gets displayed:
After few seconds(15-20 sec), forms gets saved automatically:
From usability point of view, it’s a very nice feature… then what’s going wrong??
When I came to know about this feature, few things came to my mind:
Scenario1: Lets say I have registered a workflow or a plugin on “onChange” of a field called “fax” in “account” entity. User has entered some value(1234) in the “fax” field and went on to fill other fields. After few seconds(lets say 20 sec) form gets saved automatically in the background. Incase if user feels he entered some wrong value in “fax” field so he/she modified the field again.
Prior to UR12 or with Classic Forms: User saves the form manually. Even though user modifies the same field twice, field value gets saved to the database once(in one transaction). And the workflow which is registerd will fire once and completes it’s tasks.
with UR12 Process Driven Froms: As user modifies the same field twice(one before the auto save and one after the background save), field value gets saved to the database twice(in two transactions). And the workflow which is registerd will fire twice…..
Scenario2: Lets say I have registered a workflow or a plugin on “onChange” of fields called “fax” and “email” in “account” entity. User has entered some value(1234) in the “fax” field. After few seconds(lets say 20 sec) form gets saved automatically in the background. Then user modifies the “email” field. After few seconds form gets saved in the background
Prior to UR12 or with Classic Forms: User saves the form manually. workflow will be triggered only once.
with UR12 Process Driven Froms: As user modifies two fields (one before the auto save and one after the background save), two field values gets saved to the database in two different transactions. And the workflow which is registerd will fire twice…..
To verfiy that, I have registered a workflow on “fax” and “email” field. Added a step to attach notes with fax and email field vlaues:
Result after Scenario 1:
Workflow instances:
Created Notes:
Created Notes when fax got updated to 1234
Created Notes when fax got updated to 1234567
In the same manner, for the second scenario too workflow got triggered twice…
Is it the expected behavior??? or Is it a design glitch??? or something am I missing??? So, if we gonna use Process Driven forms then what should be the considerations for extending the entity behavior??
Fingers Crossed….!!! 🙂
Share me your thoughts…!!!