UI policy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-16-2023 08:49 AM
Hi Team,
I have one requirement in form level. I have three field Ex. A, B, C (all checkbox)
if A is unchecked, B and C should read only and clear value
if A is checked, B and C should editable
if A and B is checked C should be read only and value should cleared
if A and C is checked B should be read only and value should cleared
Note: All Have OOB Ui policy for if A is unchecked, B and C should read only and clear value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-16-2023 09:02 AM
Hello @Akshaya14
You need to use OnChange Client Script :-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var checkA = g_form.getValue('A');
var checkB = g_form.getValue('B');
var checkC = g_form.getValue('C');
if(checkA==false){
g_form.setReadOnly('B',true);
g_form.setReadOnly('C',true);
g_form.setValue('B',false);
g_form.setValue('C',false);
}
if(checkA==true){
g_form.setReadOnly('B',false);
g_form.setReadOnly('C',false);
}
if(checkA==true && checkB==true){
g_form.setReadOnly('C',true);
g_form.setValue('C',false);
}
if(checkA==true && checkC==true){
g_form.setReadOnly('B',true);
g_form.setValue('B',false);
}
}
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-16-2023 11:22 PM
Hello @Akshaya14
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-21-2023 01:56 AM
thanks @Samaksh Wani , but we need three onchange client script. Instead of I achieved via 3 UI policy scripting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-21-2023 02:03 AM
Hello @Akshaya14
In that case, you can split the above script into 3 different client script.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh