I am having the below on change client script running on a device type variable, need to update the
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 06:00 AM
I am having the below on change client script running on a device type variable, need to update the countries in one new system property and need to call it in this client script.
Please help me in script.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 06:33 AM
create system property and use GlideAjax.
Within the GlideAjax function use gs.getProperty() and compare
what did you start with and where are you stuck?
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
02-07-2025 07:36 AM
I have tried like this, but no alerts or errors coming.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 07:37 AM
This is the script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:28 PM - edited 02-07-2025 01:32 PM
Try the following in your client script to call that function in the script include, assuming the name of that is
var ga = new GlideAjax('SE_HARDWARE_REQUEST'); //name of script include
ga.addParam('sysparm_name', 'getSpecialCountries'); //name of function on script include
ga.getXMLAnswer(getResponse);
and add:
alert('response = ' + response);
in the getResponse function to see what is returned.