Newbies ilo Posted August 10, 2004 Newbies Posted August 10, 2004 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
Garry Claridge Posted August 11, 2004 Posted August 11, 2004 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
Bob Minteer Posted August 14, 2004 Posted August 14, 2004 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
Recommended Posts
This topic is 7483 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 accountSign in
Already have an account? Sign in here.
Sign In Now