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

Hello @anonymous13 

The use case is not the unique network group.

It should check for all groups containing group.

@Ravi Chandra_K , We have 21 assignment group contain network. which one needs to take the sysid

Samaksh Wani
Giga Sage

Hello @Santhosh15 

 

var group = g_form.getReference('assignment_group', callbackF);
function callbackF(group){
if (group.name.contains('network')){
g_form.setVisible('u_vendor_name', true);
g_form.setVisible('u_vendor_ticket', true);
} else {
g_form.setVisible('u_vendor_name', false);
g_form.setVisible('u_vendor_ticket', false);
}
}

 

try this :-

 

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

it is working.

Samaksh Wani
Giga Sage

Hello @Santhosh15 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh