Depending on the field, another field is Mandatory and Visible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:07 AM
Hi Team,
I need to get some code as per the requirement,
1) I had a choice field in custom table which had 3 choices in the choice field X,Y,Z. so when ever I select X or Y from the "Choice Field" then the "Text Field" should be appeared and when ever I select Z from the "Choice Field" then the "Text Field" should be disappeared.
2) I had a reference field with auto updated user and when we impersonate with that user, the "Text Field" should be mandatory also there will be a check box field and if the "Check Box" field is checked then the "Text Field" should be disappeared until the ticket is closed.
Please help me on this .
Thanks,
Karishma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:40 AM
Hi Karishma,
You can do the same stuff using UI Policy in stead of complicating using client script. Try it. Because in client script you have to check all the aspects like whats happening when the form loads or gets updated.
Thanks,
Satanik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:30 AM
Hi Yousaf,
I have written the on-change client script, but there is no luck.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
var payment = g_form.getValue('u_payment_method_verified');
if (isLoading) {
if ((pm == 'u_ach' || pm == 'u_wired') && (g_form.getValue('u_cost_accountant') == g_user.userID )) {
g_form.setVisible('u_if_not_why', true);
g_form.setMandatory('u_if_not_why', true);
} else {
g_form.setMandatory('u_if_not_why', false);
g_form.setVisible('u_if_not_why', false);
}
} else {
if ((pm == 'u_ach' || pm == 'u_wired') && (g_form.getValue('u_cost_accountant') == g_user.userID )) {
g_form.setVisible('u_if_not_why', true);
g_form.setMandatory('u_if_not_why', true);
} else {
g_form.setMandatory('u_if_not_why', false);
g_form.setVisible('u_if_not_why', false);
}
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:31 AM
Is it must to do with client script in your requirement??
When you can do it with UI Policy.
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:33 AM
and shouldn't pm be payment?
***Mark Correct or Helpful if it helps.***