Can a size limit be set for adding attachments on a record producer form

kateg
Kilo Explorer

Hello,

I'm creating a Record Producer form for the Self Service Centre, and the customer has asked if there can be an attachment size limit of 50MB on this form, and a notification message if someone tries to attach something bigger than 50MB. Is there a way to set an attachment limit per form? They only want the limit on this form at this stage

Thank you,
Kate

3 REPLIES 3

Manjeet Singh
ServiceNow Employee
ServiceNow Employee

Attachment size limit is a platform wide setting -   - Administering Attachments - ServiceNow Wiki



In case you want to have a specific limit for any   you can write a business rule on sys_attachment table (Before Insert).



(function executeRule(current, previous /*null when async*/) {


  if(parseInt(current.size_bytes) > 1000000 && current.table_name == 'incident')


{


//Abort the insert if size is greater than 1MB --> 1000000bytes


gs.log('Size has been exceeded');


current.setAbortAction(true);


}




})(current, previous);


For the most recent information, use docs.servicenow.com instead of the wiki.   You can find the info on the attachment file size at Configure attachment system properties.


Aditya Telideva
ServiceNow Employee
ServiceNow Employee

Hi Kate,


To specify the maximum attachment size:


  1. Navigate to System Properties > Security.
  2. Enter a value in the Maximum file attachment size in megabytes property (com.glide.attachment.max_size). Leave the field empty to allow attachments up to a maximum of 1GB. By default, this field is blank.


Thanks,


aditya telidevara