can you post a screenshot of your script? According to the go development guide (I don't have my iPad to test), you can overwrite existing PDF files by specifying a variable path and saving the PDF to that variable path with NO dialog.
set variable $path = get(documentspath) & "file.pdf"
save records as PDF - no dialog - $path
A couple of questions—
1. Have you checked to see that you are getting multiple copies of the pdf document saved?
2. Does a pdf get overwritten if original is from the same iPad as the the replacement, but not overwritten if the replacement is from a different iPad?
Depending on the above, it strikes me that the problem could be a different document path depending on which iPad saves/retrieves the pdf.
In answer to your questions
1. There is only one file saved, the original one...no multiples showing. If I delete the original one via the file area, it then will create right one appropriately. But then try again, and the previous one shows up.
2. It doesn't get overwritten at all - thats the wierd thing. Same file name too. It is like it is an issue with the document path but I don't know where else it would save it.
And a new record is created in Filemaker Go so its not like the data isn't there...
Interesting. I regularly use a similar process to save quotes, invoices and letters as pdf's, and occasionally have to make subsequent corrections and re-save them, and I have never had an issue; the pdf is always overwritten. This is working on a MacPro using FMP/FMS. I don't know whether FMGo is giving you grief, as I have no siginifcant experience with it Go yet, but as Mike points out, it should work according to the development guide.
It might be worth testing the process in FM on a desktop or laptop to see if you get the same result as your are getting in FMGo. Another thought is to check permissions to make sure you don't have some sort of conflict there that is preventing replacement of a pdf—a Finder level problem, so to speak.
Based on your screenshot, your $FileName variable is not fully qualified. I believe you have to use:
"file:" & "ConcernsRegistration.pdf"
See this creating file paths note:
And also page 13 in the Filemaker GO development guide:
The second link reads:
To replace the output file with the new one instead of keeping multiple copies, add the file path (file:fileName or filemac:fileName) to the script. For example, if you type file:sample.pdf or filemac:sample.pdf in the Specify Output File dialog each time you run the script, the sample.pdf file in the Documents folder will be replaced with the new one.
Also, make sure you add error capturing. At the beginning of your script place a "set error capture - on" script step, then at the end of your script place a "show custom dialog" script step that has a body calculated as Get(LastError). If there is any error, it will display the number. You can disable the dialog box once it's working. Any error other than 0 would be suspicious.
I spent some time playing round with my existing script, but I kept ending up with the pdf refreshed, but then it wouldn't attach to the email! It was a total mystery as to where the files were saving if they weren't saving into the documents folder on the ipad.
Not sure what I was doing wrong so decided to start again and try the script using the temporary path as described on page 13 of the Filemaker Go Developement guide, and that seemed to do the trick on my ipad.
Have now set it up in the live database so will see if that fixes the issue!
Will let you know...fingers crossed that is now sorted!
The first time you create the script, the pdf doesn't exist so you don't have the option of telling FileMaker to overwrite or not (unless the file exists).
So, open the script and modify the save as script so that you are entering the save info fresh and new. It will notice the existing file and ask if you want to overwrite it which it didn't do since it didn't exist.
Note: a problem is encountered if people open the pdf and don't close it before running the script and if your script doesn't handled this error or captures the error and proceeds, the old file remains intact and possible may be sent rather than a new one which wasn't created. You will need to trap the error, tell your user to close the file and run the script again and exit script.