Forum post
Hi,
I have goolgled high and low for an answer to my problem.
I am setting up a request form database for my client with a php interface using the instant web publishing tools. My database is configured to send email through smtp and it works well when sending from the database with a single record, but keeps on sending from an incorrect record when there is more than one record in the database. I came across a comment, while googling, that this is a known bug.
Is this true/is there a workaround?
Any help would be appreciated.
shryn
New to PHP IWP
Filemaker Server 10
OS X Server
Answer
shryn:
Thank you for your post.
Make sure your Send Mail script uses "One mail using data from the current record" rather than "Multiple emails". As long as you have a button on the Layout to execute that script, it should send the information from the current record. Remember that Instant Web Publishing is using a browser to display the data from a FileMaker Pro database file, so if you are in List view, the last record displayed, depending on the browser, could be the current record.
TSGal
FileMaker, Inc.
Be the first to like this
|
Sign in to "Like"
Hi TSGal,
Sorry. I made a mistake. I'm asking about Custom Web Publishing with PHP, not Instant Web Publishing.
I am using the PHP Site Assistant tool to create the web interface and an email from an incorrect record is sent when the Save Record button is clicked.
I have $newPerformScript =& $fm->newPerformScriptCommand('RequestForm', 'TechEmail'); $result = $newPerformScript->execute();
script command and I have made sure "One mail using data from the current record" is set.
Sorry for the confusion.
shryn
Be the first to like this
|
Sign in to "Like"
shryn:
Thank you for the additional information.
Nothing is coming immediately to mind. However, it is obvious that the script is accessing a record other than the one you were expecting. Can you tell me anything about the "incorrect" record? Does it precede the current record? Is it the first or last record in the table? Is it the first or last record sorted? What other steps do you have just prior to the $newPerformScript->execute() command?
TSGal
FileMaker, Inc.
Be the first to like this
|
Sign in to "Like"
I would say the records sent are pretty random. Sometimes it is the first record, often it's another, but never the current record. The records aren't sorted and they are very simple, with 12 fields and no calculations, other than 2 pull-down value lists. The PHP code is completely generated by the PHP Site Assistant, except for the script trigger above. I'll attach the PHP code, if needed.
Many thanks,
shryn
Be the first to like this
|
Sign in to "Like"
shryn:
Yes, attach the PHP code. This may help provide a clue.
TSGal
FileMaker, Inc.
Be the first to like this
|
Sign in to "Like"
OK here is the code from the confirmation.php page...
Be the first to like this
|
Sign in to "Like"
Hello,
i have the same problem, the script is running on another random record, but not on the last submited record (in the same php session and on the same layout).
have you found something new ?
Thank for your help.
Be the first to like this
|
Sign in to "Like"
Hi TSGal,
Has any solution to my problem come to mind?
Best regards,
shryn
Be the first to like this
|
Sign in to "Like"
shryn:
Our Testing department would like to see your database file and PHP generated files. I have sent you a private message (top of this page - right side - envelope icon just below the blue horizontal bar) with instructions where to send the files.
TSGal
FileMaker, Inc.
Be the first to like this
|
Sign in to "Like"
It's a long shot to say the least but, whenever I find things like this happening it's when I am using a table view and have specified the wrong source table somewhere, perhaps in the actual data listing on a layout or as the layout source. E.G. If you have a table called contacts and a view of contacts 1 and a record serial field called ID, rerencing the contacts::ID when you mean to reference contacts 1::ID can produce this issue.
As i said, it's just a long shot.
Be the first to like this
|
Sign in to "Like"