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.

Retrieving field data after ADD

Featured Replies

I'm familiar with FX and now I'm trying the PHP API. In FX, the result array from an ADD operation contains the data that was just added to the database. However, when I examine the result of an ADD operation using the PHP API, I don't find the record contents. Am I missing something? Is it really there? Maybe I have to Find the last record to get the contents.

The data is all there, but it is in an object not a standard data array. If you look at the api documentation for Result and Record objects, and the methods you can use on each, you should be able to get a better understanding of how it works.

Here is a little example of how you would get field data from a found set...


$result = $findCommand->execute();

$records = $result->getRecords();



// access data from all records

foreach( $records as $record ) {

    ECHO $record->getField('fieldName');

}



// access data from only the first record

$record = $records[0];

ECHO $record->getField('fieldName');

  • 1 month later...

To clarify a little further, when you execute the add command a FileMaker result object is returned containing the record that was just added. You access the record the same way you would if you were dealing with a result generated by a find command.


$result = $addCommand->execute();

if( !FileMaker::isError($result) ){

 	$record = $result->getFirstRecord();

 	echo $record->getField("fieldName");

}

oops! he said 'add' didn't he? And off I went, rambling about looping through a found set.

he even wrote ADD in caps! :B

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.