How can we dot walk in UI policy of catalog item

Alex_3
Tera Contributor

Hello ALL ,

I have requirement to set visibility of "hr_acuity" checkbox if "hr_opened_for" is :

Only display if opened_for.location.category = XYZ

 

I have also used this in script part:

function onCondition() {

if(g_form.getValue('hr_opened_for.location.u_category')== 'xyz') {

g_form.setVisible('hr_acuity', true);

}


}

 

Any help is appreciated 

Regards,

Ruchi

1 ACCEPTED SOLUTION

Can you write a Onchange client script on hr_opened_for field with the below code:-

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var use = g_form.getReference('hr_opened_for', callBackFunc);
}
function callBackFunc(use)
{

if(use.location.u_category=="xyz")
{
g_form.setVisible('hr_acuity','false')
}
}

 

Please mark my answer as correct based on Impact.

View solution in original post

3 REPLIES 3

Saurav11
Kilo Patron

Hello,

 

Can you share some screenshot of where you are trying this the form the field and all it would be easier to assist you.

 

Thanks.

Alex_3
Tera Contributor

Thanks @Saurav11  

Ruchi1_0-1667234476117.png

If opened for i.e "hr_opened_for" location.u_category is 'xyz' then we don't have to show "hr_acuity" option and location & category is field on user table.

basically we want to dot walk hr_opened_for.location.u_category="xyz"

Can you write a Onchange client script on hr_opened_for field with the below code:-

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var use = g_form.getReference('hr_opened_for', callBackFunc);
}
function callBackFunc(use)
{

if(use.location.u_category=="xyz")
{
g_form.setVisible('hr_acuity','false')
}
}

 

Please mark my answer as correct based on Impact.