Hi all,
I have the following code in the folder level as a trusted function:
//DateTime function
function myDateString()
{
return util.printd("yyyymmdd_HHMMss", new Date());
}
// SaveAs Function
var mySaveDoc = app.trustedFunction(function(oDoc,cPath,cF1Name)
{
app.beginPriv();
var myPath = app.getPath(cPath, cFlName) + myDateString() + ".pdf";
// saveAs is the only privileged code that needs to be enclosed
// with beginPriv/endPriv
odoc.saveAs(myPath);
app.endPriv();
});
In my Save button, I have the following Javascript:
// First make sure the function exists
if(typeof(mySaveDoc) == "function") {
var sPath = this.path; // get path including file name and type
// save this doc, in sPath
mySaveAs(this, "/g/busunits/", this.documentFileName);
app.alert({cMsg:"File successfully archived!\n\n" + "Ready for QA Compliance signature. File can be closed.", nIcon:3});
} else {
app.alert("Missing Save Function\n" +
"Please contact forms administrator");
}
// end button mouse up action
It's saving to the G: folder with the name of the file but the date/timestamp is not being added onto the end. Could someone provide some guidance?
George Kaiser