Make Short Description & Description Read only on submit of incident form

keval3
Tera Contributor

Hello All

Make Short Description & Description Read only on submit of incident form

Plz let me know how to do it.

10 REPLIES 10

You mean when you click on submit button fields should be grayed out?

If so, not sure what you are trying to achieve with this. Either make it post or make it pre-submit.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so are you saying once incident is created then you need both fields readonly and not during creation?

if yes then use onLoad client script

function onLoad(){

	if(!g_form.isNewRecord()){
		g_form.setReadOnly('short_description', true);
		g_form.setReadOnly('description', true);
	}
}

Regards
Ankur

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

Thanks,But I want the field readonly once i submit the form

 

Ravi9
ServiceNow Employee
ServiceNow Employee

and what happens if someone tries to change from list view ? 

first you need to ask yourself - r u trying to control access of fields or something else 

if its access control of fields for specific user / condition then ur answer is acl 

with client script it doesnt make sense to make fields read only post submission if u want users not to change things 

your requirement is not clear. what's your business requirement?

why to make it readonly when form submits? I didn't get that part.

Regards
Ankur

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