How to populate choice filed value based on other field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
Dear Friends,
I have a on change client script where I need to populate the channel field as self service when the caller id role is ITIL. but I cant populate the channel field as self servcie. please advise. Here is the On change script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var gr = new GlideRecord('sys_user_has_role');
gr.addQuery('user.sys_id', newValue);
gr.addQuery('role.name', 'itil');
gr.query();
//g_form.addInfoMessage(newValue);
if (gr.next()) {
g_form.getOption('contact_type', 'self-service');
// g_form.addInfoMessage("iam in if loop");
} else {
g_form.getOption('contact_type', 'None');
// g_form.addInfoMessage("I am in else loop");
}
0 REPLIES 0

