Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Configure Download Preference for renaming Files using Custom Attribute values upon download
Groovy Script - Configure Download Preference for renaming Files using Custom Attribute values upon download
Updated this week

Description: Sample groovy script to configure download preference for renaming files using custom attribute values upon download

(To be used in combination with the groovy script for 'Rename Files using Custom Attribute values upon download').

Click here for detailed help.

Context: Document

Remark: Accessible in 'On-Load' task mode only

Script:

def execute(){

boolean checked = true;

boolean unchecked = false;

DocumentVO document = documentService.getDocumentDetails();

JsonArray optionList = new JsonArray();

JsonObject fileRenameOption = new JsonObject();

fileRenameOption.addProperty(IGroovyConstant.VISIBLE, true);

fileRenameOption.addProperty(IGroovyConstant.EDITABLE, true);

fileRenameOption.addProperty(IGroovyConstant.DEFAULT_VALUE, unchecked);

fileRenameOption.addProperty(IGroovyConstant.OPTION_NAME, IGroovyConstant.RENAME_FILE_OPTION);

optionList.add(fileRenameOption);

document.setResponseStatus(false);

document.setDynamicObject(optionList.toString());

return document;

}



Did this answer your question?