- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 2 hours ago
i have a requirement in SC_TASK
Assignment group : ABC
state : Cancelled / Completed
Either in the SC_TASK form or in the SCTASK list ( inline editing) should not happen.
For SC_TASK form applyed UI policy -> read only once the state is changed to cancelled or completed. But manager is changing it from SCTASK list ( Servicenow system is allowing).
can any one of you suggest ACL for the above requirement.
what i have done is:
1. create a new ACL
type : record
operation : write
decision type : Deny unless
name : Sc_task -------field : State
Applied to: blank
Roles: given X_abc_role (custom role create for a scoped application table)
Data condition: State -- is not one of -- ( selected closed complete and cancelled) and
assignment group -- is -- ABC
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @LVPhanee
Step 1: Create a before insert/update BR
- Navigate to System Definition > Business Rules and click New.
- Fill out the form:
- Name: Restrict Edits on Completed/Cancelled ABC Tasks
- Table: Catalog Task (sc_task)
- Active: Checked
- Advanced: Checked
- Under the When to run tab, configure the following conditions:
- When: Before
- Insert: Checked
- Update: Checked
- Filter Conditions:
- Assignment group is Assignment group ABC
- State is one of Closed Complete, Closed Incomplete, Closed Skipped, Cancelled
- Under the Actions tab, set the Task update message:
- Abort action: Checked
- Add message: You cannot edit this task because it is already Completed or Cancelled.
- In the Script tab, paste the following code:
(function executeRule(current, previous /*null when async*/) {
gs.addErrorMessage(gs.getMessage('You cannot edit this task because it is already Completed or Cancelled.'));
current.setAbortAction(true);
})(current, previous);
Step 2: Create a List_edit ACL
Navigate to System Security > Access Control (ACL) and click New.
Fill out the ACL:
- Type: record
- Operation: list_edit
- Name: sc_task (Select sc_task.* ) //do not select any field
In the Requires role list, add the roles that should bypass this restriction (e.g., admin).
In the Condition builder, define the restriction so that it is only editable when the task is not closed:
- State is one of Closed Complete, Closed Incomplete, Closed Skipped, Cancelled
In advance script, answer = false;
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
if you want to restrict from native list or workspace list better to use before update BR and stop the update
In workspace list onCell edit client script and list_edit ACL on field doesn't work
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I tried with Before BR, but it is still allowing and updated the state from state Closed to open. So opted with ACL is best.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
before update BR should work for Form (Native or Workspace), List (Native or Workspace)
where it didn't work?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
I noticed that the thread has been closed with another response marked as the correct answer.
I had shared my response earlier and believe it addressed the question.
If you don’t mind, could you please share what was missing or could have been improved in my answer?
Your feedback would really help me refine my responses going forward.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader