- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:38 AM
Hi Team,
If we have a field 'Security number' for each user , what will be your approach for making it visible only for that particular user?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:44 AM
Hi @Sid_Takali,
I guess that security number is stored on the sys_user record?
If so, create a field level read ACL restricted to the logged in user for that record.
So, ACL: sys_user.u_security_number (Or your field name), Read with script:
answer = current.getUniqueValue() == gs.getUserID();
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:43 AM
Hi @Sid_Takali ,
I would add a role to that group and then use a client script to display/hide that field based on whether the current logged in user has that role.
Below is an example on how to do that;
function onLoad() {
var isAdmin = g_user.hasRole('admin');
//console.log("isAdmin: " + isadmin);
if (isAdmin == true) {
g_form.setDisplay('staff_type', 'true');
} else {
g_form.setDisplay('staff_type', 'false');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:44 AM
Hi @Sid_Takali,
I guess that security number is stored on the sys_user record?
If so, create a field level read ACL restricted to the logged in user for that record.
So, ACL: sys_user.u_security_number (Or your field name), Read with script:
answer = current.getUniqueValue() == gs.getUserID();
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:49 AM
Hello @Sid_Takali ,
It depends on the requirement
if its for a group of users, add them into a group and you can create a field level ACL and check if logged in user is part of the group then make it visible using the below advanced script in ACL.
answer = gs.getUser().isMember0f('your_group_name');
IF ITS FOR A SINGLE USER the value will be static and you can simply create a UI policy where condition can be user is abel tuter , some thing like this and create a UI policy action to hide the security number filed
if its for bulk users who has got a particular role then you can check it via client script that if logged in user is having that role and if yes display the field using on load client script like below
function onLoad() {
var usrRole = g_user.hasRole('your_role_name');
if (usrRole == true) {
g_form.setDisplay('your_field_name', 'true');
} else {
g_form.setDisplay('your_field_name', 'false');
}
}
Hope this helps
Mark my answer correct if this helps you
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 02:54 AM
Hi @Mohith Devatte,
Good that you are providing different scenarios, but since the field is a security number I would never do anything else than an ACL.
UI Policies and Client Scripts can be easily overridden by disabling javascript or manipulating the html in your browser.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.