field non editable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:12 AM
Hi @zx
You can do via client script type = Oncelledit
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:29 AM
I think the OOTB approach would be to:
- Set the field to read-only
- Control updating of the field with ACL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 02:46 AM
Hi @zx ,
Making a Field Read-Only in the Form View
Using the Dictionary Entry:
- Right-click on the field label.
- Choose Configure Dictionary.
- In the dictionary entry, check the Read-Only option to make the field always read-only on the form.
Using UI Policies (for Conditional Read-Only):
- If the field should only be read-only under certain conditions (e.g., based on a user role or value in another field), you can use a UI Policy.
- Navigate to UI Policies and create a new policy.
- Set your condition (e.g., based on the value of another field).
- Under UI Policy Actions, choose the field and set Read-Only to True.
Making a Field Read-Only in the List View
There are two methods to achieve this:
Using Access Control:
- Access controls (ACLs) are used to control permissions for who can read, write, or delete records and fields.
- Navigate to System Security > Access Controls.
- Find or create an access control for incident.field_name.
- In Advanced View, set the script as answer = false; to prevent editing of the field in the list view for all users except those with explicit permissions.
Using an onCellEdit Client Script:
- This client script type can prevent users from editing specific fields in list view.
- Navigate to System Definition > Client Scripts, and create a new client script.
Set the Type to onCellEdit.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose =true;
//Type appropriate comment here, and begin script below
saveAndClose =false;
callback(saveAndClose);
}​
If You Feel that Your Issue is Resolved , Please Mark it as Helpful and Accept The Solution
Thanks Regards
Badrinarayan