Need to limit the total size of the attachments(total size of all the attachments should not exceed 20 MB) on all the forms(which has a clip icon for the attachment) and should not allow to create a record on sys_attachment table for the same and als
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 02:12 AM
Need to limit the total size of the attachments(total size of all the attachments should not exceed 20 MB) on all the forms(which has a clip icon for the attachment) and should not allow to create a record on sys_attachment table for the same and also should show an alert on the respective record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 02:22 AM
Hi,
you can refer this link and use the solution and enhance as you want to check file size of all attachments present on single record
Please enhance it to query sys_attachment for the current table sysId and add up the size and then validate
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 02:54 AM
Hi Ankur,
Thanks for replying but i need to show the message as soon as the user clicks on the attachment icon and should validate if the total size of all the attachments on that record is exceeding the limit(Suppose after attaching the 4th attachment the limit is exceeding 20 MB,then it should show an error while attaching the 4th attachment and it shouldnt be attached and only existing 3 attachments should be visible).
Also this needs to be done on every record which has attachment icon in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2022 03:06 AM
Hi,
you can use business rule on sys_attachment but that won't show the error message to the user
you can use onSubmit validation on that table
OR
you will have to customize the OOB ui page itself which I won't recommend.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2022 09:33 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader