How use a client script to check which fields were modified?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
I am writing an onSubmit client script on the Incident table. The goal that it will perform a certain action if the form was modified, except in the case that only "assigned to" and/or "assignment group" are modified. I am currently using g_form.modified to check if anything was modified at all, but I am not sure how to verify that only those two fields are changing. Is there a way to determine which fields are changing without checking each one individually?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
Hello @EJ13,
I have done something similar, but I had to use g_scratchpad in the onSubmit client script. I had control all changes in a onChange script separately and then unified values in the onSubmit client script
Here's some link which was useful for me: https://www.servicenow.com/community/developer-forum/g-scratchpad/m-p/2225478
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
Hello @EJ13 ,
There is one OOTB Table 'sys_audit' which track changes to each single change in any servicenow table,
So when I change the assignment group from Network -> Hardware & assigned to from empty -> Bow ruggeri
It's got captured in this table as record in form of new value and old value
So in this way you can keep the track of the changes you had made..
If my response help, mark as helpful and accept the solution..
