[FX.php List] How to get recid of new record

Bob Patin bob at patin.com
Mon Jun 29 23:03:47 MDT 2009


John,

I use a calc field called "recid" equal to get(recordid); there's  
another way but I never use it.

Here's how I do it; I know others will send you the other method  
(which slips my mind right now), but I like this one better because I  
need the RECID anyway for editing a record:


foreach($queryResult['data'] as $key=>$queryData{
	$recid = $queryData['recid'][0];
}


Bob Patin



Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
Twitter: bobpatin
iChat: bobpatin
AIM: longterm1954
FileMaker 9 & 10 Certified Developer
Member of FileMaker Business Alliance & FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
Web hosting • PHP • Full email services • Free DNS hosting •  
Colocation • Consulting

On Jun 29, 2009, at 11:39 PM, John Funk wrote:

> I have this code below that creates a record in FM.
> How to I get the record id of the record just created?
>
> $request = new FX($ServerIP, $port, 'FMPro7');
> $request->SetDBData($db, 'web_requests','1');
> $request->SetDBUserPass($fmAccount, $fmPass);
> $request->AddDBParam('AccountNumber', $AccountNumber);
> $request->AddDBParam('ContactName', $ContactName);
> $request->AddDBParam('Phone', $Phone);
> $request->AddDBParam('Email', $Email);
> $result = $request->FMNew();
> $records = $result['data'];
>
> // this part  below does not work
> foreach($records as $record)
> {
> $RequestRecID=$record['a_ID'][0];  // a_ID is the calculated field  
> to get the recid
> echo $RequestRecID;
> }
>
> Thanks in advance.
> John
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
Skipped content of type multipart/related


More information about the FX.php_List mailing list