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

Hello Jayanth,



I agree with Chuck on this one. The best approach would be to create ACL's and prevent people from editing these.


Reference:


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


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


k_jayanth
Tera Contributor

Thank you chuck for the advice,


I have been trying to convince to use ACL, but we have to create 3 ACL's for 3 fields but they want everything to be done in one business rule or one client script. So if there is any way to do it please mention or else i will go with the ACL's.



Thank you,


Jayanth


I propose that having one business rule or client script is harder to maintain (if even possible.) In the case of client scripts, you react to one field (in the case of onChange and onCellEdit) only so you MUST have more than one client script.



Please use ACLs as they are easier to support/maintain and provide a better user experience. Choosing to do otherwise in this case carries risk that you must be willing to accept.


Thank you chuck,


Will go with the ACL's.


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you