- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 12:06 PM
How to Visible Field based on user role (LIKE : change _manager) on change request ?
Scenario : When ever Change manger group members login that time only one more extra field (Like : Author side ) field visible. Please help me ....
Thanks,
Ram
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 08:19 AM
It's really quite messy to use a UI policy here I would recommend an onLoad client script or an ACL.
However if you simply must have a UI policy then you can create one with a condition that is always true
like number is not empty
reverse if false is off
run scripts true
Execute is true script
function onCondition() {
var hasRole = g_user.hasRole('change_manager');
if (hasRole ==true) {
g_form.setVisible('u_ram', true);
} else{
g_form.setVisible('u_ram', false);
}
}
I have tried this in a dev instance and it's fine but you are really better off using an ACL or client script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 12:12 PM
If that group has a role associated to it and you want to limit this field to be visible by only them, then the most secure way is by ACL (which means you'd need to create a READ ACL for that table and that field, specifically) However...if you don't want to go that route, then you can do a UI Policy, with no conditions, and go to script section (set it to ALL UI type) and put this in the script area:
if (g_user.hasRole('change_manager')) {
g_form.setDisplay('u_field_name', true);
} else {
g_form.setDisplay('u_field_name', false);
}
You could also use an onLoad client script with the same script above.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 05:30 AM
Hi,
I just wanted to check in and see if you needed any other assistance.
If your issue has been resolved, if you don't mind, please mark my post as Helpful/Correct.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 06:25 AM
Thanks for your response ,,
Not resolved my issues , we need through UI Policy,
Please help me ......
Thanks,
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 08:19 AM
It's really quite messy to use a UI policy here I would recommend an onLoad client script or an ACL.
However if you simply must have a UI policy then you can create one with a condition that is always true
like number is not empty
reverse if false is off
run scripts true
Execute is true script
function onCondition() {
var hasRole = g_user.hasRole('change_manager');
if (hasRole ==true) {
g_form.setVisible('u_ram', true);
} else{
g_form.setVisible('u_ram', false);
}
}
I have tried this in a dev instance and it's fine but you are really better off using an ACL or client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 08:45 AM
Thanks...
Its working fine, resolved my issue.
Thank,
Ram