[FX.php List] Updating many Records - Best Practice?

Glyn Devine glyn.devine at quickseries.com
Thu Feb 2 12:10:52 MST 2012


FX List,
> 
Many thanks for your responses!

The first one I tried was simply editing each record as the user paged
through.  This is too slow. This single query:

$q = new FX( $this->serverIP, $this->webCompanionPort, $this->dataSourceType
);
$q->SetDBUserPass( $this->user, $this->pword );
$q->SetDBData( 'Master', 'InventoryCount_Edit');
$q->AddDBParam('-recid', $uid);
$q->AddDBParam('NbrBox', $boxes);
$q->AddDBParam('NbrPack', $packs);
$q->AddDBParam('NbrUnits', $units);
$q->FMEdit();

Takes about 7-8 seconds! It takes less time to read 1300 records out of
FileMaker... Why? Is there anything I can do to optimize it? The layout has
only the 4 necessary fields on it...

If I commit all the record edits at the end, I don¹t mind if it takes 30
seconds, I can throw up a ³Please Wait...² screen or something, but could
someone show me a code sample of how to do this edit records in a portal
thing?

I assume I¹d connect, go to the right layout, run a loop calling
³SetPortalRow² for every edited record, and finish that up with an FMEdit()
- is that right? Now, just to throw a little wrench into the works, my
relationship is controlled by setting global fields. To get the right set of
records into the portal, I have to set 2 global fields (Month and Year)
first. How would I go about that?

Thanks for all the help so far!
Glyn

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120202/3a72cfe8/attachment.html


More information about the FX.php_List mailing list