The CreatorCon Call for Content is officially open! Get started here.

How to hide the incident fields based on assignment group contain "network" ?

Santhosh15
Tera Guru

Hello Experts,

 

I have one requirement, which is used to hide the two fields based on client script.

I have the onchange client script but it is not working, could you please help on this.

Santhosh15_0-1690952815847.png

var group = g_form.getReference('assignment_group').indexOf("network") > -1;
if (group == true) {
g_form.setVisible('u_vendor_name', false);
g_form.setVisible('u_vendor_ticket', false);
} else {
g_form.setVisible('u_vendor_name', true);
g_form.setVisible('u_vendor_ticket', true);
}

 

Thanks

@Ankur Bawiskar @Palani Kumar @Ravi Chandra_K @Samaksh Wani 

1 ACCEPTED SOLUTION

@Samaksh Wani , From onchange client script is not working so i done through ui policy.

it is working.

View solution in original post

19 REPLIES 19

 

if (newValue.toString().indexOf('network') > -1) {

g_form.setVisible('u_vendor_name', false);

g_form.setVisible('u_vendor_ticket', false);

} else {

g_form.setVisible('u_vendor_name', true);

g_form.setVisible('u_vendor_ticket', true);

}

 

 

Hello @Ravi Chandra_K ,

 

I tried this code but it is not working.

I added this code

Santhosh15_2-1690958303794.png

 

have you tried changing the Assignment group to any group that contains network.

since this is on change client script.

Hello @Santhosh15 

Try declaring group and check.

var group = g_form.getDisplayValue('assignment_group')

if (group.toString().indexOf('network') >= 0) {

g_form.setVisible('u_vendor_name', false);

 

g_form.setVisible('u_vendor_ticket', false);

 

} else {

 

g_form.setVisible('u_vendor_name', true);

 

g_form.setVisible('u_vendor_ticket', true);

 

}

Please hit the thumb and Mark as correct if it helped!

 

Kind Regards,

Ravi Chandra 

saipraveenkumar
Tera Contributor

We can achieve this requirement simply using UI policy by defining condition as assignment group is network.

UI action with both field visibility false.