Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Stop upload process if Document doesn't have attachment & display message to User
Groovy Script - Stop upload process if Document doesn't have attachment & display message to User
Updated this week

Description: Sample groovy script to stop document upload process if document does not have attachment & display message to user

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?