Skip to main content

Groovy Script - Stop the Upload process if the Document doesn't have an Attachment and Display a Message

Updated over 2 months ago

Description: Sample Groovy script to stop the document upload process if the document does not have an attachment and display a message.

Context: Document

Remark: Accessible in 'Pre' task mode only.

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

if (!document.getHasAttachment()) {

document.setResponseStatus(false);

document.setResponseMessage("Uploaded document should have attachment.");

}

return document;

}



Did this answer your question?