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

niki26
Mega Contributor

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.

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

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

Restriction for 5 MB, "File size exceeds. It should not be more than 5MB" on incident user should re...

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@niki26 

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader