Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
I have a request that I think I could code or that maybe already exists. The user wants to activate a workflow task that, under certain circumstances at least, reverts a field to its previous state. Of course the modtracker should be enabled for this field but is that case, could it be done?
Posts: 3,564
Threads: 36
Joined: Apr 2014
Reputation:
49
Yes, this could be done if ModTracker is active on the module. One of the challenges is determining which change you want to go back to. Imagine a field that has changed 10 times, which value does the user actually want to recover?
If you want to give the user the option to select the value I would create a detail view widget where the user could select the field, see the possible values and select which one he wants to revert to. It would be nice to have this as an option on each field, sort of a popup that appears on the field when you right-click or hover...
If you just want to go back to the previous value I would create a workflow expression function: getPreviousValue (or similar) that could be used in the update field task.
Joe
TSolucio
Posts: 855
Threads: 238
Joined: Nov 2015
Reputation:
96
Well for this particular usecase I am mainly interested in the reverting to a previous value (one step back) without the user realizing it. I do think it would be a good idea to enable the workflow admin to set the no. of steps you can go back.