Restrict choices in Reference Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 10:08 PM
Hello,
I want to restrict reference field choices based on the selection of other variable(Select box) value. Any suggestions, please need help.
Thanks!
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2020 10:47 PM
By using Client callable script include can use reference qul
gr.addEncodedQuery("Pass Your required query");
var arr = [];
gr.query();
while (gr.next()) {
arr.push(gr.sys_id.toString());
}
// gs.info("Hi "+ arr);
return "sys_idIN" + arr ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2020 08:56 PM
Hi Raviteja,
This script is helpful. A small question, I am using this script on a multiple choice field and calling the Script include using on change client script, may I please know how should i get return value to the Onchange client script.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2020 09:45 PM
HI
I have one written Article about that:
This will guide you step-by-step on how to accomplish that.
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2020 11:30 PM
Above article is helpful but I am trying achieve the functionality on choice variable and reference variable on catalog item not on tables.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2020 02:17 AM
Hi
Thanks for your feedback.
The way works pretty the same, you just need to set the Reference Qualifier on the catalog Variables (Reference Specification). Then it works the same.
Access the Catalog variables with
current.variables.your_cat_variable_name_goes_here
Give it a try and you will see, that it works the same.
Let me know if that answers your question and mark my answer as correct and helpful.
BR
Dirk