Hide attachment field to one group using business rule and ui policy ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 10:31 PM
Hi All,
I have hide attachment filed using business rule scratchpad and on load client script its working fine , Now my requirement is payment is ACH or wired then bank form has to visible and mandatory in new state only, for with i have written ui policy its working fine.After written ui poilicy scratch pad is not working .
In new state ui policy has to work every user after moving next state bank form has to visible one group and opened by user only. Please help me on this.
Onload client script:
function onLoad() {
var openedBy = g_form.getValue('opened_by');
if ( openedBy == g_user.userID || g_scratchpad.cost ) {
g_form.setMandatory('u_ach_bank_form', true);
g_form.setDisplay('u_ach_bank_form', true);
} else {
g_form.setMandatory('u_ach_bank_form', false);
g_form.setDisplay('u_ach_bank_form', false);
}
}
Ui policy:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 11:13 PM
so your bank field should be visible only for a particular group in new state if payment method is ACH or wired bank?
can you share the BR that is setting scratchpad value.
also keep infomessages in your client script and check if its going inside proper if block.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 11:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 11:18 PM
No you should not set the filter in your BR, remove your conditions
display BR's are processed when a user requests a record form but you are changing the field value of payment after load.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP