Set a Select Box value based on a checkbox and another select box option
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:49 PM
I am building an RITM, I am trying to write a catalog client script or UI policy that when the user selects Permanent Access AND checks the box for OnBase Capital Market that the type is set to All Capital Market Accounts, and read only or hidden.
I have tried a scripted UI Policy:
Catalog Client Script based on either the perm or checkbox variable:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (g_form.getValue('onbase_cap' == 'true' || vs_permtemp == 'vs_permtemp_perm')) {
g_form.setValue('type_capitalmarket_access', 'v_all_accts');
g_form.setReadOnly('type_capitalmarket_access', true);
g_form.setVisible('type_capitalmarket_access', false);
}
-------
and tried
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == "vs_permtemp_perm") {
if (g_form.getValue('onbase_cap' == 'true')) {
g_form.setValue('type_capitalmarket_access', 'v_all_accts');
g_form.setReadOnly('type_capitalmarket_access', true);
}
}
if (newValue == "") {
if (g_form.getValue('vs_permtemp' == 'vs_permtemp_temp')) {
g_form.clearValue('type_capitalmarket_access');
}
}
}
-------
and
if (isLoading || newValue == '') {
return;
}
if (newValue == 'vs_permtemp_perm') {
g_form.setValue('type_capitalmarket_access', 'v_all_accts');
g_form.setReadOnly('type_capitalmarket_access', true);
g_form.setVisible('type_capitalmarket_access', false);
}
----
and tried
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == 'true') {
return;
}
if (g_form.getValue('vs_permtemp' == 'vs_permtemp_perm')) {
g_form.setValue('type_capitalmarket_access', 'v_all_accts');
g_form.setReadOnly('type_capitalmarket_access', true);
g_form.setVisible('type_capitalmarket_access', false);
}
None of them are working, where did I go wrong?
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 10:36 PM
Hi @Michelle P here is the sample script.
The onchange client script is on checkbox variable,
script:
var getChoice = g_form.getValue('variablename');
alert(getChoice);
var getCheckBox = g_form.getValue('variablename');
alert(getCheckBox);
if (getChoice == 'choicevalue' && getCheckBox == 'true') {
g_form.setValue('variablename', 'choicevalue'); //auto populate variable
}
Regards
Harish
Harish