Make Assignment Group field read-only Before Creating Incident After created INC Not read-only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2023 11:29 PM - edited 04-16-2023 01:19 AM
Before creating the incident, how to make the Assignment Group field read-only. After created an incident, the Assignment Group field should Not be read-only (editable) for ITIL users.
How to achieve this requirement ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 09:25 PM
Hi @Suresh_32 ,
I think we have some following ways to complete your task:
- Use the "ACL" with the condition contains "current.isNewRecord()", that statement will be return true if the record is new
- Use the "Client Script" with "On load" type and the condition contains "g_form.isNewRecord()" and then make the Assignment group is read only with the statement g_form.setReadOnly("assignment_group", true).
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 01:01 AM
HI Long Duong,
ACL is not working .
ACL Script :
answer = false;
if(current.isNewRecord()){
answer = true;
}
Please correct me the above code is correct or not ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 01:17 AM
Client Script also not working.
Please help on this.
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.isNewRecord()) {
//alert('This is a new record!');
g_form.setReadOnly("assignment_group", true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2023 01:05 AM
you can use onLoad client script
function onLoad(){
if(g_form.isNewRecord()){
g_form.setReadonly('assignment_group', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader