Make read only fields on incident
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:53 AM
Hi All,
Recently we have one requirement, For incident, set read only fields on from level when below condition:-
1) Incident is active.
2) User is not member of assignment group
3) Do not apply for users with admin role
I achieved by using ACL but client need on form level i know using client script we can achieve but i am not with coding any help in coding much appreciated.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 08:23 AM
Hi @Yugandhar1 ,
Do you want to use client script or business rule ?
Below is the code by using business rule :
(function executeRule(current, previous /*null when async*/ ) {
var active = current.active;
var assignmentGroup = current.getDisplayValue('assignment_group');
if (active == true && (!gs.getUser().isMemberOf(assignmentGroup)) && (gs.getUser().hasRole('admin'))) {
//set fields readonly
}
})(current, previous);
Vishal Birajdar
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates