check logged in user has approval role
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
3 weeks ago
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.
100 % GlideFather experience and 0 % generative AI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
