- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:08 AM
Hi All,
I want to make assigned to mandatory when state changes to Closed Complete in List view.
I have created a client script onCellEdit. Field- state
I added the logic if State is Closed Complete and Assigned to or Assignment group is empty then it will not allow to save.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
var ag = g_form.getValue('assignment_group');
var as = g_form.getValue('assigned_to');
if (newValue == 7 && ((ag == '') || (as == '')) {
alert("Assignment group or Assigned to should not be empty")
saveAndClose = false;
} else {
saveAndClose = true;
}
callback(saveAndClose);
}
It is not working. Please help in this.
Thanks,
Samiksha
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:41 AM
Hi Samiksha,
just for my understanding: do you want to have Assigned To mandatory so that it will block the row update in list view, when state changes to "Closed Complete"? In this case, you could consider a data policy. This should run on your task table for the condition that "State [is] Closed Complete". The data policy action would define "Assigned To" as mandatory[=]true.
If you use the data policy as UI policy as well, you with the same step apply your requirement to the form view.
Or did I get your request wrong?
Best regards
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:41 AM
Hi Samiksha,
just for my understanding: do you want to have Assigned To mandatory so that it will block the row update in list view, when state changes to "Closed Complete"? In this case, you could consider a data policy. This should run on your task table for the condition that "State [is] Closed Complete". The data policy action would define "Assigned To" as mandatory[=]true.
If you use the data policy as UI policy as well, you with the same step apply your requirement to the form view.
Or did I get your request wrong?
Best regards
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 03:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 04:23 AM
Hi Sam,
so actually your Data Policy (created it on my instance as well) should do this, when you try to update an unassigned task in the list view:
Doesn't that work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 04:25 AM
Hi @Martin Saeckel ,
Yes, I have created business rule. While testing I didnt make that inactive. I deactivated that and its working as expected now.
Thank you😊,
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 04:23 AM
Hi @Martin Saeckel ,
It is working. Thanks.