Showing selectbox option based on condition in record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 02:07 AM
Hello All,
I have one variable type: select box name:pplsys_related_to , which has 3 options ADD,UPDATE,REMOVE.
Based on option selected in checkbox and opened_for location category I have to show UPDATE option.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
var category = g_form.getValue('hr_opened_for');
var UKG = g_form.getValue('ukg_ultipro_citrix_ultipro_backoffice');
var ga = new GlideAjax('IC_populate_user_details');
ga.addParam('sysparm_name', "myLocationCategory");
ga.addParam('sysparm_category', category);
ga.getXMLAnswer(function(response) {
var answer = response;
if (answer == 'corporate' && UKG == 'true') {
g_form.addOption("pplsys_related_to ", "Update Access", 2);
}
else{
g_form.removeOption("pplsys_related_to", "Update Access");
}
});
}
can anyone suggest what is missing here?
Thanks!,
R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 02:43 AM
Hi @Alex_3
Is your code in correct format? like below:
g_form.addOption("variableName",choiceValue,choiceDisplay);
Murthy