- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 09:17 PM
I have a requirement to pass value from onChange client script for list type field to script include. Am using the below code but getting undefined value.
Client Script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 12:01 AM
Reference qualifier wont work using "g_form.setReferenceQualifier" . Instead of using onChange client script you will need to use Advanced Reference Qualifier for the field where you want the reference qualifier to be applied. You can change the function "getChoices" to accept the parameter as follows:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 11:36 PM
@shantanu_patel8 @Ankur Bawiskar Am able to get correct data in script include now. But am passing this data to client script to make a query using g_form.setReferenceQualifier and that is not working.
Client Script code:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 12:01 AM
Reference qualifier wont work using "g_form.setReferenceQualifier" . Instead of using onChange client script you will need to use Advanced Reference Qualifier for the field where you want the reference qualifier to be applied. You can change the function "getChoices" to accept the parameter as follows:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 12:40 AM
is this "g_form.setReferenceQualifier" working?
If yes then is it working in native and portal both or only native?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 02:02 AM
@Ankur Bawiskar I didn't used g_form.setReferenceQualifier for this now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 11:21 PM
Another thing to note is that unless your script include was created in the global app scope, you will need to add your own app scope in the client script:
var ga = new GlideAjax('Test');
may need to change to:
var ga = new GlideAjax('x_mycompanyprefix_myapp.Test');
Ron