- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 12:55 PM
I'm looking for a sample client script to do the following
I have a Select box Variable on a SC named "Group Role"
based on the selection
FT
FTA
FATA-5
I want the following Variables to become Visible/Mandatory/hidden
org name
org access
org rights
Justification
Dual Role
if
FT FTA FATA-5
Mandatory -org name Mandatory -org name Hide - org name
Mandatory - org access Visible - org access Hide - org access
Mandatory - org rights Mandatory - org rights Hide - org rights
Visible - Justification Visible - Justification Manadatory - Justificaiton
Hide -Dual Role Hide -Dual Role Manadatory - Dual Role
any suggestions
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 01:02 PM
Here is the client Script ( but my suggestion you can go for UI Policies)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var orgName = g_form.getValue('org_name');
var orgAccess = g_form.getValue('org_access');
var orgRights = g_form.getValue('org_rights');
var justification = g_form.getValue('justification');
var dualRole = g_form.getValue('dual_role');
if (newValue === 'FT') {
g_form.setMandatory('org_name', true);
g_form.setMandatory('org_access', true);
g_form.setMandatory('org_rights', true);
g_form.setVisible('justification', true);
g_form.setVisible('dual_role', false);
} else if (newValue === 'FTA') {
g_form.setMandatory('org_name', true);
g_form.setVisible('org_access', true);
g_form.setMandatory('org_rights', true);
g_form.setVisible('justification', true);
g_form.setVisible('dual_role', false);
} else if (newValue === 'FATA-5') {
g_form.setVisible('org_name', false);
g_form.setVisible('org_access', false);
g_form.setVisible('org_rights', false);
g_form.setMandatory('justification', true);
g_form.setMandatory('dual_role', true);
}
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 01:02 PM
Here is the client Script ( but my suggestion you can go for UI Policies)
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var orgName = g_form.getValue('org_name');
var orgAccess = g_form.getValue('org_access');
var orgRights = g_form.getValue('org_rights');
var justification = g_form.getValue('justification');
var dualRole = g_form.getValue('dual_role');
if (newValue === 'FT') {
g_form.setMandatory('org_name', true);
g_form.setMandatory('org_access', true);
g_form.setMandatory('org_rights', true);
g_form.setVisible('justification', true);
g_form.setVisible('dual_role', false);
} else if (newValue === 'FTA') {
g_form.setMandatory('org_name', true);
g_form.setVisible('org_access', true);
g_form.setMandatory('org_rights', true);
g_form.setVisible('justification', true);
g_form.setVisible('dual_role', false);
} else if (newValue === 'FATA-5') {
g_form.setVisible('org_name', false);
g_form.setVisible('org_access', false);
g_form.setVisible('org_rights', false);
g_form.setMandatory('justification', true);
g_form.setMandatory('dual_role', true);
}
}
Thanks and Regards
Sai Venkatesh