Guru Salem Posted March 26, 2012 Posted March 26, 2012 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
doughemi Posted March 26, 2012 Posted March 26, 2012 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()); 1
Guru Salem Posted March 26, 2012 Author Posted March 26, 2012 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
doughemi Posted March 26, 2012 Posted March 26, 2012 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. 1
Guru Salem Posted March 26, 2012 Author Posted March 26, 2012 :yay: Wow.. Thank you doughemi.. Now i found the record id.. and i can able to edit the record without the issue
Recommended Posts
This topic is 4960 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