- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2019 12:22 PM
I have a script include and catalog client script (below).
My alert shows a comma separated list of subcategory value, subcategory label for all the correct choices based on the dependency to category. My only issue is getting those values "into" the variable to be displayed on the record producer when the corresponding category is chosen.
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 02:15 PM
We got it done internally.
The updated Catalog Client script is below. It all works beautifully now.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearOptions('u_subcategory_task');
var ga = new GlideAjax('CatSubcatChoices2');
ga.addParam('sysparm_name','Choices');
ga.addParam('sysparm_cat',g_form.getValue('u_category_task'));//Tested this is correct
ga.getXML(function(response) {
var msg = response.responseXML.documentElement.getAttribute('answer').split(',');
for(var i=0;i < msg.length; i++){
g_form.addOption("u_subcategory_task", msg[i], msg[i]);//
}
}
);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 02:15 PM
We got it done internally.
The updated Catalog Client script is below. It all works beautifully now.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
g_form.clearOptions('u_subcategory_task');
var ga = new GlideAjax('CatSubcatChoices2');
ga.addParam('sysparm_name','Choices');
ga.addParam('sysparm_cat',g_form.getValue('u_category_task'));//Tested this is correct
ga.getXML(function(response) {
var msg = response.responseXML.documentElement.getAttribute('answer').split(',');
for(var i=0;i < msg.length; i++){
g_form.addOption("u_subcategory_task", msg[i], msg[i]);//
}
}
);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 06:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 09:12 AM
Hi Claudine,
I'm working on the similar requirement and my script include is not working.
Can you please post your script include for reference or where did you use the variable name that needs to be returned to client in the script include after while loop?
Ak