Is there any way to make selected fields read only in list view using Oncelledit function

k_jayanth
Tera Contributor

I need to make active, priority and state fields read only in list view of the problem records, how can i make it without using ACL's.

Thanks,

Jayanth

1 ACCEPTED SOLUTION

The proper way is to use an ACL to prevent people from editing these. That's my first and best recommendation. Even if you don't have access to create the ACL, find someone who does and assign this requirement to them.



Using onCellEdit means the person already has access to edit the element. I suppose you could simply replace the newValue with the oldValues in the script. The user would think the made an edit, but actually didn't. You may even be able to just disable the callback statement.


View solution in original post

9 REPLIES 9

Chuck Tomasi
Tera Patron

Hi Jayanth,



I'm curious what the business requirement is behind this one. Can you help me understand?


Hi chuck,



The requirement is just to make those 3 mentioned fields non-editable from the list view, so that the user cannot select fields in mass and change it in the list view. I can achieve it by ACL using 'List Edit' , but i have been restricted to use ACL, so i have to achieve it by other means. So i though i could do it using 'Oncelledit' but i have no idea how to make it 'read only'..


List.png


So i have to achieve something like this for all three fields(state,priority,active) without using ACL.


The proper way is to use an ACL to prevent people from editing these. That's my first and best recommendation. Even if you don't have access to create the ACL, find someone who does and assign this requirement to them.



Using onCellEdit means the person already has access to edit the element. I suppose you could simply replace the newValue with the oldValues in the script. The user would think the made an edit, but actually didn't. You may even be able to just disable the callback statement.


Chuck, I know this is really old, but ACLs won't always work.  If the field needs to be popualted by a template being applied, but not editable by the user directly, an ACL would stop the value from being saved when the user saves it.  They need write access, but the field has to be read only.

But if they add the field to their list view, and it's not controlled by an ACL, they can edit the field.

This requirement would need a way to make the field read only both on the form and on the list.  The form is easy to do with a Client Script.  But the list....

 

I found out that there is an ACL for list_edit.  Instead of limiting permission on write, use list_edit.