how to check whether a field is read only or not

Rohit Agarwal
Mega Expert

is there any way to check whether a field is read-only or not using client script?? 

6 REPLIES 6

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Have you tried:

g_form.isDisabled('FIELD_NAME');

For example, below works:

function onLoad() {
   
	g_form.addInfoMessage(g_form.isDisabled('priority'));

}

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

check here:

https://community.servicenow.com/community?id=community_question&sys_id=10b4c3e9dbd8dbc01dcaf3231f96...

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

@Rohit Agarwal 

Did this solve your question? Or do we need to follow-up on this?

If I have answered your question, please mark my response as correct and helpful.

Thank you very much

Cheers
Alberto

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Did this solve your question? Or do we need to follow-up on this?

Please mark this answer as correct if it solves your question. This will help others who are looking for a similar solution. Also marking this answer as correct takes the post of the unsolved list.
Thanks.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn