Jump to content

Record is missing error on createRecord


This topic is 5391 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 by Guest
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 5391 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.