[FX.php List] Best practice of selecting products from a list
Bob Patin
bob at patin.com
Sun Apr 12 12:55:01 MDT 2009
John,
I might consider saving the selected products in a single record,
single field, in a list, which you could then parse back out for
display purposes.
So when you display PRODUCTS, I'd then collect the checkboxes using a
loop, write all the recIDs to a single variable and save it in a field.
For displaying it on a subsequent visit, you would read the record and
field, and then write a loop that creates a table row (or DIV) for
each line of the record, displaying that record's data based on that
RECID.
I wouldn't think that having 700 records in SELECTEDPRODUCTS, just on
the off-chance that they might select 10 of them, would be the way to
go, although I don't think my method would be any faster. The only
gain in speed would be from not needing to generate 700 records in
SELECTEDPRODUCTS for each company. This way, SELECTEDPRODUCTS would
only contain actual selected products for each company, and not 700
per company.
Regardless of how you do it, you'll have to look at all 700 displayed
products to see if they were selected; this means looping thru the 700
and doing an FMEDIT for each selected product.
Don't know if this helps, I'm jumping from topic to topic here on my
computer, not focusing on any one task too well!
Bob Patin
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
AIM: longterm1954
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP • Full email services • Free DNS hosting • Colocation • Consulting
On Apr 12, 2009, at 1:37 PM, John Funk wrote:
> I have an FM database with COMPANIES, PRODUCTS and SELECTEDPRODUCTS
> tables to use for an online survey.
> The user logs in to see their Company data along with a list of all
> the products available. The list is a checkbox list that when they
> check the product, it records that product in the SELECTEDPRODUCTS
> table for that Company.
>
> My question is, what is the best way to display all PRODUCTS and
> save the chosen products in SELECTEDPRODUCTS.
> Showing the records from the PRODUCTS table and when selected have a
> looping FMEdit() that writes data to SELECTEDPRODUCTS for that
> COMPANY or
> Showing the records from the SELECTEDPRODUCTS table and write the
> data back to the same table. This requires I pre-build a set of
> records in SELECTEDPRODUCTS for each company. This seems like it
> would run faster but take longer to build the data.
> There are about 700 PRODUCTS to display (on 5-6 pages) for 1000
> COMPANIES
>
> If I use the looping FMEdit() method, I was thinking I could put the
> FMEdt() in a function to call from the loop.
>
> Any thoughts before I dig in? Any sample code?
>
> Thanks,
> John Funk
> _______________________________________________
> 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