read-only a field in list view

Mr_X1
Tera Contributor

I wanted to make the "Request item" field read only on list view.

 Currently im using onCellEdit client script [ below code ], Its not getting save but i want the field to be Read-Only

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = false;
callback(saveAndClose);
}

Can you please show me how to make the field read-only

 

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

1) elevate your role as security_admin

2) create new list edit ACL on catalog task table and field as request_item

3) use advanced checkbox as true

4) admin overrides uncheck - means even admin cannot list edit

4) script as

answer = false;

find_real_file.png

Regards
Ankur

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

View solution in original post

13 REPLIES 13

Hi Ankur

I had a similar problem, and found your sugestion helpfull, thanks.
It does though leave me with the problem that the list edit ACL prevents changes to the specified field in all list view.
In my example I have a list view of workorders, which is displayed dot walked values from the location table. I wan tto keep people from changing theese fields in the list of work orders (which your suggestion does perfectly).

BUT. when people now go to the cmn_location table where they should be able to edit the fields in list view. They can not.

So it would be helpfull if it would be possible to restrict or allow the list edit on specific list views.
Do you have sugestions on how (if)  that be achieved ?

Best regards

Martin

@Martin Gr 

not sure if it can be done for specific list view

As per my experience it cannot be done

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

Thank you Ankur.. Apreciated 🙂

Priya103
Tera Contributor

@Ankur Bawiskar  I want the same field  to be READ Only in workspace list view as well. how will this be possible?

Hello,

What if I want to have a field read-only on one list view but still editable on another list view ?

Say I have table A and table B where a field on A is a reference to B.

I need to show a field from table B on the list view of table A, but here that field should be readonly; fields from table A should still be editable.

But on the list view of table B, that same field should be editable.