Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Validate Doc Ref Uniqueness at Project Level
Groovy Script - Validate Doc Ref Uniqueness at Project Level
Updated over a month ago

Description: Sample groovy script to validate document reference uniqueness at project level

Context: Document

Remark: Accessible in 'Pre' task mode only

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

boolean isExist = documentService.isDocRefExist(document.getDocRef(), RevisionDetailsOption.PROJECT_LEVEL_UNIQUE);

if(isExist){

document.setResponseStatus(false);

document.setResponseMessage(document.getDocRef() + " : DocRef already exists in other folder, please update.");

}

return document;

}



Did this answer your question?