Making 3rd variable hidden on selecting the 1st and 2nd variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 06:57 AM
Hi All,
I have a requirement where by selecting BPML 1 and BPML 2, BPML3 contains data then BPML 3 should become mandatory.
If by selecting BPML 1 and BPML, BPML3 contains no data, then BPML3 should not be visible and not mandatory
How to achieve this with UI policy.
In my instance
1)BPML1 variable is of the type select box
2)BPML2 variable is of the type Lookup select box
3)BPML3 variable is of the type Lookup select box
Case 1 : For the below image the variable BPML3 should be visible and should be mandatory as of now its visible .
Case 2: For the below image the variable BPML3 Should be hidden as it doesn't contain data within it.
How to achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 07:38 AM
Hi @phr
You can follow the below procedure:
For this scenario:
Case 1 : For the below image the variable BPML3 should be visible and should be mandatory as of now its visible .
Create a UI Policy:
Set the Conditions to check if BPML1 and BPML2 are selected (non-empty).
and in UI Policy Actions:
make BPML3 as mandatory true and visible True.
To check whether BPML3 contains data or not.
You can use Run script and add the following code: in Execute IF true
function onCondition() {
var bpml3 = g_form.getValue('bpml3'); //change the field name
if (bpml3) {
g_form.setMandatory('bpml3', true);
g_form.setDisplay('bpml3', true);
} else {
g_form.setMandatory('bpml3', false);
g_form.setDisplay('bpml3', false);
}
}
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 09:44 AM
Hi @SAI VENKATESH ,
I tried to make use of the Ui policy, but seems like the backend variable name i am not able to select.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 09:55 AM
Hi @phr
if you are using catalog then, create a catalog ui policy and select applies to catalog item, select your catalog item AND in catalog conditions select,, BPML1 is not empty, BPML2 is not empty , BPML3 is empty -- then mark BPML 3 to mandatory false and visible true