Make Assignment Group field read-only Before Creating Incident After created INC Not read-only

Suresh_32
Tera Expert

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 ?

9 REPLIES 9

Long Duong
Kilo Sage

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 !!

HI Long Duong,

ACL is not working .

Suresh36_0-1681804728612.pngSuresh36_1-1681804795552.png

ACL Script :

answer = false;
if(current.isNewRecord()){
answer = true;
}

Please correct me the above code is correct or not ?

Client Script also not working.

Please help on this.

Suresh36_2-1681805744344.png

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);
}
}

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Suresh_32 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader