Newbies Shabby Posted July 29, 2011 Newbies Posted July 29, 2011 Hello, today I tryed, to delet a record with the API. I've read how the code has to be. But in the line §cmd->setField the Script fails. $fm = new FileMaker('DB', 'http://mac.equitania.net', 'user', 'passWord'); $cmd = $fm->newFindCommand('Layout'); $cmd->setField('Kategorie', 'Tests'); *Script fails $cmd->setField('Aufgabe', 'Test Aufgabe'); $result = $cmd->execute(); if(FileMaker::isError($result)){ echo 'ERROR'; die(); } $records = $result->getRecords(); $recordId = $records[0]->getRecordId(); $cmd = $fm->newDeleteCommand('Layout',$recordId); $result= $cmd->execute(); if(FileMaker::isError($result)){ echo'ERROR2'; die(); }
webko Posted August 2, 2011 Posted August 2, 2011 I suspect that if it is failing at the first set field, then you're not really getting access to the database... $fm = new FileMaker('DB', 'http://mac.equitania.net', 'user', 'passWord'); I think the db name requires the .fp7 extension, and I'd try just a host name rather than speccing the http protocol, and see if that gets you any further. Also, it would be more useful if you isError actually gave you the error code back if (FileMaker::isError($result)) { echo 'Error: ' . $result->message . '(' . $result->code . ')'; die(); }
fmbug Posted August 2, 2011 Posted August 2, 2011 Please visit this link, it might be helpful to you http://rsgss.co.in/RsgssForum/index.php?p=/discussion/4/deleting-record-using-fm-api
Newbies Shabby Posted August 2, 2011 Author Newbies Posted August 2, 2011 @webko I dont think thats the problem, because I used the same connection to add a record and read out records. The error wont be given out, the script fails before this line. Please visit this link, it might be helpful to you http://rsgss.co.in/R...rd-using-fm-api I'll try these thanks, but when somebody knows how to get a specific record, like I tryed in my code, please tell me.
fmbug Posted August 2, 2011 Posted August 2, 2011 Please visit the following link, it might be helpful to you... http://rsgss.co.in/RsgssForum/index.php?p=/discussion/4/deleting-record-using-fm-api
Genx Posted August 30, 2011 Posted August 30, 2011 Please nobody try to delete records like that... it's kind of like seeing an apple in a crate and unpacking the whole crate just to get to the apple you want.
doughemi Posted August 30, 2011 Posted August 30, 2011 Your line $cmd->setField('Kategorie', 'Tests'); should be $cmd->addFindCriterion('Kategorie', 'Tests'); Likewise with the line following. --Doug
Recommended Posts
This topic is 5090 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