- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 11:20 AM
Hi All,
Just a small query.
I have Variable which is referring to custom table.
Custom Table :
Role Display is Reference variable and above "Test Table" is used for reference. So When i select US-Store in the "Role Display" it should show relevant "US"country related location in the "Location" variable. here if US-STORE (then it is US country store. If they select (NZ-Store) then its is News Zealand country store.
So i tried script include and reference qualifier like below. But whatever i tried that is static one. I just wants to change that to dynamic one as per above logic.
Script Include :
getLocation: function(role_display) {
var gr=new GlideRecord('cmn_location');
return 'country=Australia^u_active=true';
},
Reference Qualifier :
javascript:new LocUtils().getLocation(current.variables.role_display)
Its working as expected. but if i have one store then it should be fine but i have many stores. So i just wanted to change this to dynamic one. can anyone help me on this?
Thanks in Advance!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 02:02 AM
I have created script include and called the script include in the reference variable using advance.It worked .
Thanks all for your support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 11:28 AM
I belive you can directly try below query in 'Reference qual', no need of script include.
javascript:'country='+current.variables.role_display+'^u_active=true'
Please try and let me know the result.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 02:57 PM
I had a similar need and that worked perfectly, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 11:41 AM
Hi Ashok,
Thanks for your response.
The country field is not present in my custom table. System does'not know US-Store((its only in custom table)) is US country store. Somewhere we have to say that US-Store is US .That is the reason i went to script include.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 12:07 PM
I would suggest creating a reference field to location in the Test Table. Because the store table should ideally store the location of the store.
And then use that field in the reference qualifier. Currently you are hard-coding the county, which is wrong.
Please mark this response as correct or helpful if it assisted you with your question.