- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 02:45 PM
To All Helsinki and Service Portal Users,
The Issue: Record Producer is not populating dependent variables in the Service Portal like it does in the Native UI
Assumptions: Related to the applied Client Script that isn't running in the Service Portal
Service Portal Results:
I have record producers available in the Service Catalog with dependent fields based on a client script that is currently applied. In the record producer, the "Category" is defaulted and passes to the incident ticket's Category field. The subcategory populates based on category that is defaulted, which also passes to the Subcategory field on the incident ticket. Here is how it looks in the record producer form:
Here's the behind the scene things:
Record Producer Script to pass the category and sub to the incident ticket:
Catalog Client Script applied to the record producer to filter the Subcategory based on the Category
If anyone has any idea why the client scripts applied to the record producer do not function as they should in the Service Portal, please let me know!
Also, if any further information is needed, I am more than willing to provide it
Thank you all,
-Marques
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 10:14 PM
Hi Marques,
The issue here is that your GlideRecord query is still synchronous and needs a call back function. When you mark it as "mobile" or "both" you have to update all your script to use the mobile version of the API.
Here is the modified script.
function onChange(control, oldValue, newValue, isLoading) {
if(newValue == oldValue){
return;
}
//remove all items from subcat drop down to start
// Used the g_form.clearOptions() function instead of g_form.removeOption() function
g_form.clearOptions('subcat');
//build a new list of dependent options
var gp = new GlideRecord('sys_choice');
gp.addQuery('dependent_value', newValue);
gp.addQuery('element', 'subcategory');
gp.query(function(gp) {
while(gp.next())
g_form.addOption('subcat', gp.value, gp.label);
});
}
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 02:56 AM
Hi ,
You have use a proper glideajax call for this case . I had this problem earlier last year but used the proper glideajax call with script include . I will try to find the code and will post here accordingly .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2017 06:51 AM
Hi marques,
Can please post the correct answer?