You can use the following command instead of what you have:
var filePath = "/h/";
var newFileName = this.getField("Mlastname").valueAsString + " " + this.getField("Mfirstname").valueAsString + " PcDec.pdf";
Works perfect thank you for the help.
Where put you the Folder Level Script and where did you put the Document Level Script ?
I get the error message "UnsupportValueError : Value is unsupported. Parameter cPath
The Document Level Script I put in the Text Value - Calculate tab in de stamp pdf.
Is that correct ?
You should add the code to a form button.
I've created a dynamic stamp where the user has to fill in some information.
Information like invoice number, Cost Center, filename, supplier, company....
The first question is : I want to save the document with the filename the user has filled in.
How can I do that ?
The second question is : I want to save the document in the "company" directory.
He has to choose the company from dropdown (in the stamp). So, I want to save the document in the "company" directory.
The user has 3 "company's" possibilities A, B or C. When he choose for ex B then the document has to be saved in the B map.
And the last question is : He also has to choose if the document is invoice or document. If it's a document then under the company (choose by stamp) under documents map. Else under company invoice map.
mySaveAs.js file (located in the map program files"
var mySaveAs = app.trustedFunction(
// Ensure path has trailing "/"
//cPath = cPath.replace(/([^\/])$/, "$1/");
cPath = "/c/temp/";
oDoc.saveAs(cPath + cFlName);
app.alert("Error During Save " +e);
Is this file correct ?
What and where do I have to fill in the code in the stamp under the "save" text field - calculate - custom calculation script.
(because when I put a button I don't see that button.
Using Adobe XI
PS : I figurerd out that I can do a save as but it's the stamp file. And not the document with a stamp.
And when you put the OK button in the stamp document and you run it then you see the button but it doesn't work.
You can choose for mouse up, mouse down, mouse click, ...
But non of them work.