Task shouldn't close without an attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 12:03 AM
Hello Folks,
I've a requirement to restrict a user to close a particular SC task without attachment. I've catalog item, it will generation a 10 SC task, my requirement is to restrict task assignee to close that particular task(which has using short description) without an attachment. For this I've tried On submit catalog client script and also a business rule. For business rule it showing the error message but after the closing the task only. It should not be like I should restrict the assignee to close the task without an attachment. I'm attaching the Business rule condition and script. please help me on this.
Thanks,
Naveen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 12:33 AM
Hi @Avee90
You can check this link for your problem
https://www.basicoservicenowlearning.in/2020/10/attachment-mandatory.html
Please mark helpful and mark as correct if it helps you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:13 AM
Hello Sarthak,
Thanks for responding. This is for catalog item form for not sc task.
Thanks,
Naveen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:17 AM - edited 04-08-2024 01:20 AM
Hi @Avee90
Please check the below script
function onSubmit() {
var getCount = getSCAttachmentCount();
if(g_form.getValue('field name') == 'yes'){
if(getCount <= 0) {
alert('Attachment is not empty.');
g_form.addErrorMessage('Attachment is not empty.');
return false;
}
}
}