January 8, 201016 yr Newbies 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!
January 9, 201016 yr 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
January 14, 201016 yr 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 January 14, 201016 yr by Guest
Create an account or sign in to comment