Description: Sample Groovy Script to validate document reference uniqueness at the project level.
Context: Document
Document Type: File
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;
}
