Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fatal error issue with the same php code

Featured Replies

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

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());

  • Author

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

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.

  • Author

:yay: Wow.. Thank you doughemi..

Now i found the record id.. and i can able to edit the record without the issue

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.