Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5419 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello,

We have a FileMaker Solution and are using the FileMaker PHP API to produce a custom site. Certain fields, like a module's name i.e. "Contacts" have their labels stored in a record that gets generated as they log in. So the record ID is seemingly random. The only way to retrieve a record's data, as far as I can tell, is to use:

$record = $fm->getRecordById('LayoutName',recordID).

I see there is a method newFindAnyCommand('LayoutName'), which might work except this does not return a FileMaker_Record, but instead a FileMaker_FindAny class. I hope I'm being clear enough, still getting used to the FM API here. Thanks for your time!

Posted

If it gets generated at login, it should be the last record in the database at that point... so doing the findall with a sort on the recordid (highest to lowest) should work I think

Posted (edited)

If it get's generated as they login then you should have access to the FileMaker Result object which will contain a list of records that were returned - in this case 1 single record that you just created. On a side note I'm reasonably sure that you can't sort on record id though i'm not sure why you'd want to.


$add = $fm->newAddCommand('layout');

$add->setField('someField',$someValue);

$result = $add->execute();



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

$record = $result->getFirstRecord();

$recordId = $record->getRecordId();



/*You could store the id of the record in the user's session here as well if you wanted for later use.*/

}

Edited by Guest

This topic is 5419 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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