Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Stop the Upload process if the Document doesn't have an Attachment and Display a Message

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

Updated over 3 weeks 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?