- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 09:48 AM
Greetings, everyone.
So, I'm trying to configure a pair of UI actions: "Place on hold" and "Resume working". What I'm trying to achieve is: When I click on "Resume working", I want it to revert the "State" to its previous choice, i.e. the choice of "State" when I clicked on "Place on hold". Examples:
- If the State was "Work in progress" when I clicked on "Place on hold", then, when I click on "Resume working", I want the State to be reverted to "Work in progress".
- If the State was "Work in progress" when I clicked on "Awaiting additional info", then, when I click on "Resume working", I want the State to be reverted to "Awaiting additional info".
Would anyone be kind enough to point me at the right direction?
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 12:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 12:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 12:47 PM - edited 12-12-2022 12:48 PM
I would create a on Change Client script that stores the previous value of the state.
This example uses the description field to store the value, but I would recommend you create a new variable on incident table. You can then reference this value when the UI actions runs to restore the old value?
Thanks...Gary
Code:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
g_form.setValue('description',oldValue);
}