// ServiceNow

Minimum attachment size control

If you want to set minimum attachment size control to sys_attachment table you can create business rule to sys_attachment table as you can below. (Turkish explanation is available).

var size = 10240;
if(current.size_bytes < size){
  
  if( current.content_type=='image/png' || current.content_type=='image/jpeg' || current.content_type=='image/gif'  ){
    gs.addInfoMessage( " Eklenti boyutu izin verilen sınırın altındadır. ( " + size + " ) " );
    current.setAbortAction(true);
  }
  
  
}

This code block will check attachment size and attachment type (jpeg,png,gif)

You can discart all image resized by your selection.

TR : Thanks to this code block, images below the dimensions you specify will not be added to the attachment table. You just need to add this code as a business rule on the sys_attachment table.

 

// FEEDBACK

Was this useful?

Your rating shows how helpful this note is to other readers.

Was this useful?

Click the stars to rate.

Average rating 0 / 5. Total votes: 0

No one has rated this post yet. Be the first!

Sorry this post was not helpful.

Your feedback is valuable to us.

How can we make this post more helpful?

// JOIN THE CONVERSATION

Share your experience

Got a question, a different solution or a note to add?

// KEEP READING

One more note.

All posts ↗︎