- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 04:42 PM
Hi there.
i have created a field u_onq_id on the user table (sys_user) i need this field to be visible only for ITIL user i have been trying to used an UI policy but havent had luck. this is what i have tried:
but its not working. i have also tried an ACL and client script but not luck i will appreciate any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2017 01:07 AM
Hi,
Few things to point out in your script as mentioned below:
1) gs.getUser() is a server side function and cannot be used on client side i.e. it cannot be used in the UI Policy or client Scripts. So that is the main reason why your UI Policy was not working.
You can update your UI Policy on the User Table as per the script mentioned below in the screenshot:
I have tested this on my personal instance and it's working for me. Kindly test the same from your end also.
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 04:56 PM
You can either apply a Field level Read ACL or an onLoad Client script.
With ACL, you can permanently restrict Read access and that field won't be readable even in List View. With Client script, you can restrict the field on form view, however it will be visible in list view and in reports to that user.
For any of the above approaches, you need to use: g_user.hasRole("itil"); for restricting read role.
In ACL:
if(g_user.hasRole("itil"))
return false;
In client script
if(g_user.hasRole("itil"))
{
g_form.setVisible('u_onq_id',false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 05:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 02:09 AM
in client script we have to do that using onchange or unsubmit or on load

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017 06:10 PM
Hi Carlos,
I am not sure you want to try in that way and if it helps.
Please create ACL for your customised field (right click on the field and go to Configure dictionary), then create a new Read/Write (ACL) as per your requirement. You need to have security_admin elevated privilege to create the ACL.
When it navigates to Access Control page, please assign the ITIL role in that.
I have just given an example on incident table, you can try on sys_user table similarly.