[FX.php List] Updating many Records - Best Practice?
Joel Shapiro
jsfmp at earthlink.net
Wed Feb 1 11:45:26 MST 2012
Hi Glyn
If you *can* have the records that need updating be in a portal, it
will be a lot faster editing them that way, since FileMaker treats
that as editing just one record (the parent) with lots of fields --
instead of looping through each record and performing an edit for each
record.
One other thought: Would it help to have the edits performed
immediately (per field or per record) via AJAX, instead of submitting
all edits all at once?
Best,
-Joel
On Jan 31, 2012, at 3:22 PM, Chris Hansen wrote:
> Glyn,
>
> If you're updating, it's possible to update multiple rows of a
> portal with a single FX call. You might even keep track of which
> rows have actually been updated so you only update the records you
> absolutely have to. That said, I wonder if there wouldn't be a way
> to script something on the server side; with the number of records
> your talking about I think that would be faster.
>
> Best,
>
> --Chris Hansen
> FileMaker 7/8/9 Certified Developer
> Creator of FX.php
> "The best way from FileMaker to the Web."
> www.iViking.org
>
> On Jan 31, 2012, at 3:04 PM, Tim 'Webko' Booth wrote:
>
>>
>> On 01/02/2012, at 2:17 AM, Glyn Devine wrote:
>>
>>> Hi all,
>>>
>>> I'm writing a web-app to talk to my company's filemaker database.
>>> It's for
>>> inventory.
>>>
>>> The app runs a query on the products table to find the ones that
>>> we're
>>> checking inventory for, this usually returns about 1300 records.
>>> (This
>>> initial step takes about 3-5 seconds) I store the resultant FX
>>> array into
>>> the user's session. I use the array to allow the web app to
>>> quickly page
>>> through the products. The inventory numbers (3 fields - boxes,
>>> packs, units)
>>> entered by the user are stored in the array as well.
>>>
>>> Once all the inventory numbers are entered, I will have the user
>>> commit his
>>> entered inventory to the filemaker database. What's the best way
>>> to update 3
>>> fields each for 1300 records in a way that's not dead slow?
>>> Sample/pseudo-code would be appreciated. I've never actually used
>>> FX.php to
>>> WRITE to records before.
>>
>> Well, I'd have another part of the array that indicates whether a
>> particular record has been updated on commit.
>>
>> You haven't indicated whether this is a straight write (new
>> records), or an update (modifying existing records). If the latter,
>> I'd also get the -recid when creating the initial array.
>>
>> Also, be aware that FileMaker returns *everything* from the
>> specified layout - I tend to create special web layouts with only
>> the exact fields I need for an operation to reduce the extraneous
>> traffic.
>>
>> That aside, there really is no way other than to do a foreach that
>> does each update/create one at a time.
>>
>> HTH
>>
>> webko
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list