August 10, 200421 yr Newbies I have a just quick question. Is there a easy way to get the last record id entered. I know the way to go it in mysql but not with filemaker and FX.php. any help appreciated
August 11, 200421 yr The data returned from the "-new" action can contain the "CurrentRecID". I use PHP but don't use FX however somebody who is familar with FX may be able to show a particular method. Good Luck. Garry
August 14, 200421 yr Do you mean the RecID of the last record you "just created" or the last record in the file ? I am asking because if you are in a multi-users scenario, these could be quite different. If it's the record "just created", you can obtain the recID from the results of the FMNew call as such: FMNew ($returnDataSet = true, $returnData = 'full') Creates a new record in FileMaker pro with fields populated with the values specified by instances of the AddDBParam() function. By default, data is returned -- the record just created. // Not a complete query, FX() and SetDBData() are missing... $InstanceName->AddDBParam('FirstName', $firstName); $InstanceName->AddDBParam('LastName', $lastName); $InstanceName->AddDBParam('Office', 'Austin, TX'); // ... that being done, you should be able to retrieve the RecID of // the record JUST CREATED. $ReturnedData = $InstanceName->FMNew(); // stores the new record in $ReturnedData $recKey = key($ReturnedData['data']); $recordPointers = explode (".",$recKey); // where $key is the current key from $ReturnedData['data'] $recID = $recordPointers[0]; // here's the RecordID $modID = $recordPointers[1]; // and here's the ModifyID
Create an account or sign in to comment