Filtering based on organization in a table on the order guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 12:50 PM - edited ‎09-07-2023 02:22 PM
Hello currently I'm trying to filter based on organization in the order guide and using a variable as a reference field & created a script include to only show role records that match the organization. right now all the records are showing containing other organizations but i only want the ones to show that are from "Texas". any feedback is appreciated
TEXASUtil.prototype = {
initialize: function() {},
// UTIL script include
getRole: function(Organization) {
var buildQuery = 'sys_idIN';
if (organization == 'Texas') {
var gr = new GlideRecord('u_states'); //u_states = states table
gr.addQuery('u_organization', Organization);
gr.addQuery('u_active', 'true');
gr.query();
while (gr.next()) {
buildQuery += "," + gr.sys_id.toString();
//reference qualifier i have in order guide variable that is referenced
javascript: new TexasUtil().getRole(current.variables.organization)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 01:35 PM
Hi HenryD,
It is hard to say without the complete function definition. What are you returning? If you post the complete function, folks here can then help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2023 06:35 PM
Hello @HenryD ,
You just need to put reference qualifier :
- javascript:"u_organization="+ current.variables.organization;
I guess no need to write script include.
Hope this work....!!
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates