RemoveOption doesn't work for new model
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 06:39 AM
Hello,
I have the following function, it works fine for 'Normal' and 'Emergency' models, but it does not remove options for a model I created 'Nespresso'. Do I need to setup the model in Script Includes or something?
function onLoad() {
if (g_form.getReference('chg_model').name == 'Normal' || g_form.getReference('chg_model').name == 'Emergency') {
g_form.removeOption('close_code', 'Completed');
g_form.removeOption('close_code', 'Completed with issues');
g_form.removeOption('close_code', 'Failed');
g_form.removeOption('close_code', 'Unauthorized');
g_form.removeOption('close_code', 'Cancelled');
g_form.removeOption('close_code', 'Rolled back');
g_form.removeOption('close_code', 'Policy violation');
}
if (g_form.getReference('chg_model').name == 'Nespresso') {
g_form.removeOption('close_code', 'Unsuccessful');
g_form.removeOption('close_code', 'Successful');
g_form.removeOption('close_code', 'Successful with issues');
}
}
Interestingly, if I try adding g_form.addOption('close_code', 'Test'); for the new model it adds a blank record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 04:14 AM
Can ignore, I found the actual values via 'Configure Dictionary'