Make field read only in list view

Community Alums
Not applicable
 

Hi all,

There are several fields( 20 fields)  to make ready only in list view  is there any way to  Create  a Single  onCellEdit client script or ACL  for all field to make  read only  in list view .

We tried UI policy which is not working in list view

Thanks,

4 REPLIES 4

RaghavSh
Kilo Patron

You will have to create 20 ACLs if you don't want it on entire table. That is how the ACLs work.

You can make use of "insert and stay" and create all ACLs by changing the field name.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023

Community Alums
Not applicable

Create new OnCell edit script.

Create new variable (lets say myFields) which will be array holding all your fields you want to make read only.

The just loop over this array and on every iterable use g_form.setReadOnly(myFields[i], true);

 

On second thought - you can try using g_list as well .

AbdulrehmanT
Kilo Guru

// List of fields you want to make read-only in list view
var readOnlyFields = ['short_description', 'request_item', 'due_date', 'description'];

// If the field being edited is in the read-only list, block editing
if (readOnlyFields.indexOf(current.name) > -1) {
answer = false;
} else {
answer = true; // allow list edit for other fields
}