Make assignment field mandatory on the incident form after saving (SOW)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
once we select the assignment group and after saving the record in the incident form, the field needs to become read only in the service operations workspace. we can't change the assignment group. The below code is not giving the expected output
- Labels:
-
Workspace : Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
"Hi, the reason your script isn't behaving as expected is that onLoad only executes once - when the form first loads. When you save a record in the Service Operations Workspace, the form often doesn't perform a full page refresh, so the onLoad logic doesn't re-trigger to lock the field.
You should avoid scripting this entirely. The best practice in ServiceNow is to use a UI Policy. It is more efficient, easier to maintain, and natively supports the Service Operations Workspace.
Navigate to UI Policies and create a new one for the incident table.
Condition: Set it to Assignment group | is not empty.
UI Policy Actions: Add Assignment group and set Read only to True.
Crucial Settings:
Ensure 'On load' is checked.
Ensure 'Reverse if false' is checked (this allows the field to unlock if the group is cleared).
Ensure 'Applies to Workspace' is checked (this is likely why your UI policies might have seemed not to work in the past).
By using a UI Policy, you don't need to worry about the 'Save' trigger—the platform handles the UI state automatically as soon as the condition is met."
If this helps, please acknowledge it with a thumbs up or by accepting the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
why not use field level WRITE ACL and block the edit?
In that ACL condition check Created by [IS EMPTY] -> means allow edit only during insertion
💡 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
7 hours ago
But i don't have ACL access
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
I will recommend using ACL for this
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
