- 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:08 PM
Create your extra field and then write a ui policy to only display it to members of a group.
If it needs to be more secure create a field level acl for read/write and link it to change manager role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2019 12:19 PM
Thanks for your Response,
I Created Ui policy but not work , please provide your Ui policy or any other scripts.
My project condition , any hiding fields is there , through ui policy to hide it .
Thanks
Ram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 12:28 AM
Ram
You can either use a policy based on a condition that is always true or you can write a client script.
For the client script Allen already had the code posted
So script type is on Load and as mentioned you want to use the ui type of All
Code as below
if (g_user.hasRole('change_manager')) {
g_form.setDisplay('u_field_name', true);
} else {
g_form.setDisplay('u_field_name', false);
}
replace the u_field_name value with the name of the field you wish to hide from non-change managers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2019 05:31 AM
Thanks.
If helpful, please mark as such.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!