Pbeyrouty Posted August 28, 2009 Posted August 28, 2009 (edited) This has really got me stumped. I am trying to create a new record from our website when someone fills out a form. I've done this before, but for some reason every time I try to do it I get a Filemaker Error 101 Record is missing. Here is what I have $form = $fm->createRecord('Web.Forms'); if(isset($_POST['HomeNum'])) $form->setField('Contact.Home', $_POST['HomeNum']); if(isset($_POST['MobileNum'])) $form->setField('Contact.Mobile', $_POST['MobileNum']); if(isset($_POST['Email'])) $form->setField('Contact.Email', $_POST['Email']); ... $result=$form->commit(); if (FileMaker::isError($result)) { $error=$result->code; echo " Error $error: " . $result->getMessage() . ""; }else{ echo "Your answers have been saved. Thank you for your time.";} When I run this I get "Error 101: Record is missing". I checked and the login has fun access to create records in the table and the ability to access the layout via php. I also tried using $form = $fm->newAddCommand and $form->execute with the same results. Any suggestions? Edited August 28, 2009 by Guest
Pbeyrouty Posted August 31, 2009 Author Posted August 31, 2009 FYI for anyone with a similar problem, I solved the issue. The problem originated with the fields that had periods in their names. For instance the Contact.Email field. Once I changed the names to something without periods it works fine. That is pretty annoying considering I name fields that way often for organization. Oh well.
Baloo Posted August 31, 2009 Posted August 31, 2009 I would highly suggest using another convention. A period is generally used in SQL to separate database names from table names from field names in queries. e.g. SELECT table1.name, table2.name FROM table1 JOIN table2 ON table1.ID = table2.table1_ID You can always get around it by using text delimiters in your query (e.g. table1.`Contact.name` for MySQL; table1.[Contact.name] for SQL server) but that can be a real PIA to maintain and/or read and is a recipe for bugs down the road.
jonathanstark Posted September 9, 2009 Posted September 9, 2009 If memory serves, you use a period in a field name via CWP to indicate that you want to edit a particular repetition of a field. Hence the error.
Recommended Posts
This topic is 5936 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now