- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:04 AM
Hello All,
I have a requirement , where I have one variable on my Form as 'Status change' which is a selectbox and it contains multiple option such as cancelled , on hold , waiting for resource etc , whenever User changes the value of the 'Status Change' variable from one field to another the worknotes should get updated.
For eg : Status was changed from <<old value >> to <<new value>>
Can anyone help me how I can configure this functionality in my Form .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:20 AM
you can write onChange Catalog Client Script on that variable for your catalog item
1) Applies on Requested Item
2) Script as this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var str = 'Status was changed from ' + oldValue + ' to ' + newValue;
g_form.setValue('work_notes', str);
g_form.save();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:10 AM
Hello Pooja ,
do you work on incident form??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:12 AM
Hi,
Follow the steps:
Open the record for the table and scroll down and click on Activity filter
Scroll down and click on Configure Available fields.
Then select your required variable and put that in the selected bucket.
Hit Save.
Now whenever that field value will be updated you will see it in the worknotes.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:19 AM
Hi
and the variable 'status change' will only be visible on RITM and not on the Form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 03:20 AM
you can write onChange Catalog Client Script on that variable for your catalog item
1) Applies on Requested Item
2) Script as this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var str = 'Status was changed from ' + oldValue + ' to ' + newValue;
g_form.setValue('work_notes', str);
g_form.save();
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader