- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 04:43 AM
I am having issue in ACL.
I want a checkbox field in user table to be edited only by the user who's profile it is. Nobody else has the right to edit that field. For eg. I can make check/uncheck that field in my user profile. Nobody else can do.
I have written a script but that is not working. Can anybody help me on that.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 05:49 AM
Hi Sri,
you are comparing user_name with current.sys_id in below line
us.addQuery('user_name', current.sys_id);
This won't work since current.sys_id will give you sys_id and user_name field in user table has user name
use this
gs.getUserName()in place of current_sys_id.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2016 08:14 PM
var us = new GlideRecord('sys_user');
us.addQuery('sys_id', gs.getUserID());
us.query();
if (us.next()){
answer = true;
}
else
answer = false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-02-2020 07:26 AM
Use this... it should work fine:
if (gs.getUserID() == current.sys_id)
answer = true;
else
answer = false;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 10:12 AM
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate answer as correct & helpful to close the thread.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2020 06:16 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark it correct so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader