dbTalk Databases Forums  

filter portal in FMP 10 older

comp.databases.filemaker comp.databases.filemaker


Discuss filter portal in FMP 10 older in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christoph Kaufmann
 
Posts: n/a

Default filter portal in FMP 10 older - 04-02-2010 , 12:38 PM






I found a way to filter an order's line items portal, but I'm not sure
if there's an easier/better way. Here's the tables:

ProductType
TypeID

Products
ProductID
TypeID (foreign key)

Orders
OrderID
g_TypeFilter

LineItems (join table)
OrderID (foreign key)
ProductID (foreign key)

Since the list of line items can grow longish, I want to filter the
portal by type: Show me the items ordered, but only if the product type
is [xy].

I thought this should be rather simple, but I couldn't get my mind round
it. I need to go from the orders to the line items, the line items table
doesn't have a type field. If I used a calc field to display it, it
couldn't be indexed and the relation wouldn't work. I'd have to use a
data field for the type, filling it with auto-enter and create redundant
data.

In order to avoid this, I put a global field for the type in the order
table and added a calc field that used the list function to

a) get all the ProductIDs of a type if there is something in the field
g_TypeFilter
b) get all the ProductIDs of the ordered items if there's nothing in the
field g_TypeFilter.

Now I use this g_TypeFilter field together with the OrderID on the left
side of the relation that drives the portal.

Haven't tested the performance on the server, and anyway: the list
function came with FMP9, people must have solved problems like this
before that: is there something obvious I overlooked? Apart maybe form
forcing users to stick to one type per offer?
--
http://clk.ch

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.