Prevent non-admin users from modifying, adding, or removing columns in the Default list view layout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
Hello,
We have a requirement to prevent non-administrator users from adding or removing columns in the default list layout across all tables.
We attempted to address this using Before Business Rules on the sys_ui_list and sys_ui_list_element tables.
Business Rule 1 (on sys ui list)
- Filter Conditions: View is Default view
- Applied on : Insert , Update , Delete
- Condition: !gs.hasRole('admin')
- Script: Aborts the action and displays an error message.
Business Rule 2 (on sys ui list element)
- Filter Conditions: List ID.view is Default view
- Applied on : Insert , Update , Delete
- Condition: !gs.hasRole('admin')
- Script: Aborts the action and displays an error message.
During testing, we found that while the default list layout successfully restricts users from adding new columns via Configure > List Layout, the system concurrently deletes all other existing fields from the default view.
Does any one work on the same / any idea for this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
code looks fine.
You will have to debug.
Even if you raise case with ServiceNow they won't help much regarding this as this is a custom solution
💡 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader