How to set fields as Read only

shaik_irfan
Tera Guru

Hello Everyone,

I have a requirement where i need to set list of fields as Read only:

1.Number

2.Type

3. Program

By configuring dictionary of the field i can set Type & Program as read only but i unable to set Number field as Read only.... I dont know whether it is a Best practice or not, can anyone please guide me the best practice to set read only for above fields

1 ACCEPTED SOLUTION

Can i know the reason why you are going with Client Script.



In case its requirement, then go ahead with Onload client script and write the code as :---- g_form.setReadOnly("field_name",true);



But I would still suggest go ahead with UI policy.


View solution in original post

10 REPLIES 10

anurag92
Kilo Sage

You can create a UI policy if you want to set a field as read only always (if unable at dictionary level).



http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy


balaji_charapal
Kilo Guru

Hi Shaik,



You set read only by using UI policy, client script   or you can write ACL for number field.


snehabinani26
Tera Guru

For Number field, go ahead and configure it via dictionary as it should be applicable everywhere but for the fields specific to a table use UI Policy if those field are not extended from parent tables.



Hope this helps you.


Sneha,



can you help me out using client scirpting ?