check logged in user has approval role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2026 08:15 AM
If logged-in user does NOT have Travel Approver role, make Approval Remark field read-only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2026 01:36 AM
Hi @foramp,
could you possibly explain the process exactly? It will vary whether it is in client or server side.
there's the method 1) hasRole('itil') and 2) hasRoleExactly('itil') - difference is in inheritance, admin will be 1) true and 2) false....
so based on what you want to achieve then you will apply this accordingly.
Answers generated by GlideFather. Check for accuracy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2026 01:53 AM
use this and give correct field name and role name
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setReadOnly('approval_remark', !g_user.hasRoleExactly('travel_approver')) // your field name here
}
OR
You can use field level WRITE ACL on that Field and give Travel Approver role in roles section
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
