Use this Scrip in button , Its says error please help
// get the value of the form field var text1Value = this.getField("OrderNumber").value;
// here you need to make sure that no illegal characters are used, and also that text1Value is not empty
// make a file name from the field value var newFileName = text1Value + ".pdf";
// get the path where the file is currently located var filePath = this.path.replace(this.documentFileName);
// create the new full path var newFullFilePath = filePath + newFileName; try { this.saveAs(newFullFilePath);
// Only this will not work from a button... } catch (e) { app.alert("Error! Could not save as: " + newFullFilePath); }
