Forum Discussion
alderaan
8 years agoIdeator III
From what I understood you want to retrive File Item from the document template and copy that File Item so you can attach it to the actual Document created from that template? If yes you can copy the file with "copyAsNew" method. The code could look something like that:
var fileCopy = this.getInnovator().newItem("File", "copyAsNew");
fileCopy.setAttribute("id", fileID); // ID of original File Item
fileCopy.setAttribute("useInputProperties", "1");
fileCopy.setProperty("filename", fileName); // fileName is the name of your new copied File
fileCopy = fileCopy.apply();