- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 04:48 PM - edited 03-31-2025 11:03 PM
Can anyone help me understand why this simple script is causing the info message to be displayed twice only within SOW?
I should add there is no other onChange client scripts that are associated with this field. Checking or unchecking isolated script appears to make no difference once so ever.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 01:46 PM
From our SOW admin:
I went and duplicated the new record page and checked the whole duplication issue after and everything seems to be working just fine now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 05:23 PM
Hello @johndoh
I am only able to reproduce the issue when I select Email as Channel twice however in between select a different Channel choice; so modified the onChange Client script a bit:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || isTemplate) {
return;
}
//Type appropriate comment here, and begin script below
if (newValue === 'email') {
console.log('Testing');
g_form.addInfoMessage('Testing');
g_form.setValue('description', 'test');
} else {
g_form.clearMessages();
}
}
Try playing with UI Type to see if it makes any difference!
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 05:50 PM - edited 03-31-2025 06:04 PM
Same issue:
I can confirm that I am only selecting the email channel once. This also seems to happen with the State field for me but there are other client scripts, so I created this to see if there was a conflict.
If I change the type to desktop the info messages arent dispayed as designed as this SOW. If I change to Mobile/Service Portal both are displayed.
Just to make sure I did perform a cache.do and also made no difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 08:26 PM
did you try creating a fresh client script and see?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 08:42 PM - edited 03-31-2025 08:43 PM
The fresh script is what is on this thread, my original script is much more in-depth and uses the state field instead but like your thought was trying to eliminate possibilities. I will note I am in a domain separated environment and if history has taught me anything is most likely the cause 🤣 but if global or domain I get the same outcome.