Example - Restrict a field with a script
reference australia Updated Sep 10, 2026 1 min read r_ExampleRestrictAFieldWithAScript.md
This access control prevents everyone from editing an incident with a category of Software in a list. It is defined by a script.
[Omitted image "RestrictSoftwareIncidents.png"] Alt text:
-
Type: record
-
Operation: list_edit
-
Name Incident:[incident]
-
Admin overrides: Clear the check box.
-
Script:
JavaScriptif (current.category == 'software')answer = false;elseanswer = true;
35 lines · 1.2 KB
---
title: Example - Restrict a field with a script
description: This access control prevents everyone from editing an incident with a category of Software in a list. It is defined by a script.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/platform-administration/list-administration/r\_ExampleRestrictAFieldWithAScript.html
release: australia
product: List Administration
classification: list-administration
topic_type: reference
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Configuring contextual security, List editor, Administer, List administration, Forms, fields, and lists, Configure core features, Administer the ServiceNow AI Platform]
---
# Example - Restrict a field with a script
This access control prevents everyone from editing an incident with a category of Software in a list. It is defined by a script.
\[Omitted image "RestrictSoftwareIncidents.png"\] Alt text:
- **Type:** record
- **Operation:** list\_edit
- **Name Incident:**\[incident\]
- **Admin overrides:** Clear the check box.
- **Script:**
```
if (current.category == 'software')
answer = false;
else
answer = true;
```
| title | Example - Restrict a field with a script |
| description | This access control prevents everyone from editing an incident with a category of Software in a list. It is defined by a script. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/platform-administration/list-administration/r\_ExampleRestrictAFieldWithAScript.html |
| release | australia |
| product | List Administration |
| classification | list-administration |
| topic_type | reference |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Configuring contextual securityList editorAdministerList administrationFormsfieldsand listsConfigure core featuresAdminister the ServiceNow AI Platform |