How can I make a field in Service Portal as read only?

Student1
Tera Contributor

Hello,

I have the following requirement.

I want to have a field on Service Portal's form, that is read only. It will contain a value but the end user can not change it.

Is this possible?Any ideas?

1 ACCEPTED SOLUTION

Hi,

you can create onload catalog client script and

1) set the UI Type as Mobile/ Service Portal so that this script executes only for portal and not for native

2) Applies to Catalog Item - true

3) Catalog item - Select your catalog item

4) Type - onLoad

5) Applies on Catalog Item view - true

function onLoad(){

g_form.setReadOnly('city', true);

}


find_real_file.png

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Willem
Giga Sage
Giga Sage

Can you share a print screen of the page the field is on?

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Is that field required to be read-only only for portal and not for native?

please provide some screenshots for help

Regards
Ankur

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

find_real_file.pngHere is my form. I want when the City field to be as a read-only field. So, it will contain a value but the user can not change it.

If its possible, I want it to be read-only only for the portal.