July 29, 201114 yr Newbies 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(); }
August 2, 201114 yr 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(); }
August 2, 201114 yr 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
August 2, 201114 yr Author Newbies @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.
August 2, 201114 yr 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
August 30, 201114 yr 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.
August 30, 201114 yr Your line $cmd->setField('Kategorie', 'Tests'); should be $cmd->addFindCriterion('Kategorie', 'Tests'); Likewise with the line following. --Doug
Create an account or sign in to comment