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
8 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
8 hours ago
but i needs to work after saving the record, when we use ui policies, it is going to read only state as soon as we selected but that's not, we are expecting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
try to give some timeout for your script
Ensure UI Type - ALL
function onLoad() {
applyAssignmentGroupState();
setTimeout(function() {
applyAssignmentGroupState();
}, 200);
}
function applyAssignmentGroupState() {
if (g_form.isNewRecord()) {
g_form.setReadOnly('assignment_group', false);
return;
}
var assignmentGroup = g_form.getValue('assignment_group');
g_form.setReadOnly('assignment_group', !!assignmentGroup);
g_form.setReadOnly('assigned_to', false);
}
💡 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
it is not working in service operations workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
what debugging did you do?
UI type - ALL?
Global checkbox checked on client script?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
