- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:07 PM
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.
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 01:08 AM
@Samaksh Wani , From onchange client script is not working so i done through ui policy.
it is working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 11:16 PM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 11:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 12:01 AM
have you tried changing the Assignment group to any group that contains network.
since this is on change client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 12:07 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2023 10:31 PM
We can achieve this requirement simply using UI policy by defining condition as assignment group is network.
UI action with both field visibility false.