March 26, 201213 yr 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
March 26, 201213 yr 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());
March 26, 201213 yr 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
March 26, 201213 yr 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.
March 26, 201213 yr 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