Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Below code is working well for the table of "ForTest" with the layout name of "ForTest";

$rec = $fm->getRecordById('ForTest', "3");

$rec->setField('name', "jacky");

$result = $rec->commit();

But the same code wont support for another table as "Projectdocument" with the layout name for "PDTest" like the changed parameter below

$rec = $fm->getRecordById('PDTest', "6");

$rec->setField('projectname', "contactmgmt");

$result = $rec->commit();

this code show the error like "Fatal error: Call to undefined method FileMaker_Error::setField()"

What is the wrong i have done in the "Projectdocument" table or layout... please share your experience with the solution...

Many Thanks in Advance

Posted

You have to find out which error is being returned by the getRecordById() command:

$rec=$fm->getRecordById('PDTest', "6");

if(FileMaker::isError($rec)){

	die('Error - ' . $rec->getCode() . ' ' . $rec->getMessage());

  • Like 1
Posted

Thanks for your valuable reply doughemi..

with the help of your error tracking php code, i found the error "Error - 101 Record is missing".. But here records are available in particular table and layout ("PDTest")...

Please find the attached screenshot for your reference and let share your comments

Once again thanks for your timely support

post-98385-0-16316700-1332767985_thumb.j

Posted

Is the ID field actually a calculation Get(RecordID)? The PHP API command is looking for the Filemaker-generated internal Record ID. If you have created and deleted records in that table, you possibly don't have record ID 6 any more.

Another possibility is a type mismatch. Your code asks to find a string "6", and the API may not recognize that as being the same as the number 6. Try changing the find command to

$rec=$fm->getRecordById('PDTest', 6);

edit: Never mind. Your other working example eliminates that possibility.

  • Like 1

This topic is 4641 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.