Jump 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.

Featured Replies

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

}

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

}

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

  • 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.

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

  • 4 weeks later...

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.

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

Important Information

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

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.