
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 10:40 AM
Hey Everyone,
We have a script include that is being called in a variable list collector. In the reference qualifier section we have the following javascript: new dtbeLocation().NTIPJurisdiction(current.variables.u_state_name);
Our script include isn't client callable, but it works on the standard ui as an advanced reference qualifier for a glide_list field.javascript: new dtbeLocation().NTIPJurisdiction(current.u_state_name);
We are using the same field name as in the standard ui for u_state_name.
What are we doing wrong?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 09:56 AM
Hey Everyone!
Yes, it has to be client callable to work. After changing the script include into a client callable, it worked. Thank you all for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:17 AM
@Community Alums
since it's list collector it will have multiple values so try using IN
I believe u_state_id is a reference field on the table x_g_cfd_dtbe_help_location
NTIPJurisdiction : function(state) {
var sysIDs = [];
var gr = new GlideRecord("x_g_cfd_dtbe_help_location");
gr.addEncodedQuery("element=jurisdictions^application=NTIP Application^u_state_idIN"+state);
gr.query();
while(gr.next()) {
sysIDs.push(gr.getUniqueValue());
}
return "sys_idIN"+sysIDs.toString();
},
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-30-2023 09:56 AM
Hey Everyone!
Yes, it has to be client callable to work. After changing the script include into a client callable, it worked. Thank you all for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2023 08:12 PM
@Community Alums
both the places from where you are calling is server side so even if it's not client callable it should work fine.
Can you explain the solution?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2023 07:11 AM
Hey Ankur,
Yes, my architect explained that since it is a server-side script include we couldn't call it on the record producer. We had to use ajax which is automatically included in the script when we make it client callable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2023 08:19 PM
@Community Alums
to call script include from a field or variable of catalog item it can be client callable or normal script include.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader