onChange Script (revert back)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2015 08:26 AM
Hi All,
When using an onChange client script for example a true false field, how do you make it revert back when the value has been changed back to its original.
As it stands my script will work but wont revert back when the value has changed back to what it was before.
i'm sure its something simple
Regards,
Graham

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2015 08:36 AM
Hi Graham,
You can use the oldValue at client script side to set the previous value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2015 01:17 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == 'Major Incident, true') {
return;
}
g_formSetValue('Priority', 1);
return
}
}
This is what i have so far, what i need is when the 'Major Incident?' check box is unchecked the Prioirty returns to its old value.
not sure how to do this, any help would be appreciated
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2015 01:56 AM
You have to write one more client script on priority field.
Logic will be something like if the newvalue and oldvalue is not same and the checkbox is unchecked then set the priority to the oldvalue.
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2015 10:40 AM
So are you saying that for any field you want to get the 'oldValue' for you need to have a script to capture that?