dbTalk Databases Forums  

Portals - Found Sets

comp.databases.filemaker comp.databases.filemaker


Discuss Portals - Found Sets in the comp.databases.filemaker forum.



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

Default Portals - Found Sets - 06-15-2011 , 09:35 AM






FM10adv

I would like to create a portal on an ORDERS layout (table ORDERS
2008) that shows a 'found set'.

For ease of use I want to design a layout with the Order form on the
left and a Tab Control to the right. The Tab Control will hold a
series of Portals. Two of these portals currently are: 1) a list of
all the Orders in descend chronological order, 2) the payment history
of the Contact . These are imbedded and working.

Another useful portal, the 'Found Set' portal, would show all the
Orders where field, Status_Order = "Ordered". This limits the list to
those Orders not shipped, and in need of attention. Shipped orders
are; Status_Order = "Shipped".

One might say create a List View layout of the Orders and a button to
navigate to this layout. I have, however, this is not as elegant as
the Tab Control approach. With the Tab Control you do not have to
navigate away from current Order to see the information you want. You
can also change the current Order (left side) by a related record go
to.

I hope this is clear. Is this possible? How?

Thanks
Matt

PS: My layout relationships are predictably:
ORDERS_kp_OrdersID = CONTACTS_kf_OrdersID (this gives me the Contacts
Order History)
CONTACTS_kp_ContactsID = ORDERS_kf_ContactsID,
ORDERS_OrdersPortal_InvoiceList_All X ORDERS_kp_OrdersID (this gives
me the portal that shows all Orders)

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: Portals - Found Sets - 06-17-2011 , 06:35 PM






In article
<60b7c41d-fc0c-4293-ad9a-8577b96ec5dc (AT) 18g2000prd (DOT) googlegroups.com>,
Buckbuck <buck.matthew74 (AT) yahoo (DOT) com> wrote:

Quote:
FM10adv

I would like to create a portal on an ORDERS layout (table ORDERS
2008) that shows a 'found set'.

For ease of use I want to design a layout with the Order form on the
left and a Tab Control to the right. The Tab Control will hold a
series of Portals. Two of these portals currently are: 1) a list of
all the Orders in descend chronological order, 2) the payment history
of the Contact . These are imbedded and working.

Another useful portal, the 'Found Set' portal, would show all the
Orders where field, Status_Order = "Ordered". This limits the list to
those Orders not shipped, and in need of attention. Shipped orders
are; Status_Order = "Shipped".

One might say create a List View layout of the Orders and a button to
navigate to this layout. I have, however, this is not as elegant as
the Tab Control approach. With the Tab Control you do not have to
navigate away from current Order to see the information you want. You
can also change the current Order (left side) by a related record go
to.

I hope this is clear. Is this possible? How?

Thanks
Matt

PS: My layout relationships are predictably:
ORDERS_kp_OrdersID = CONTACTS_kf_OrdersID (this gives me the Contacts
Order History)
CONTACTS_kp_ContactsID = ORDERS_kf_ContactsID,
ORDERS_OrdersPortal_InvoiceList_All X ORDERS_kp_OrdersID (this gives
me the portal that shows all Orders)

It's possible to have a portal / relationship to display almost any
grouping "related" records ... as long as you set-up the appropriate
fields, key / link data and relationship definition. )

In this case you want the Order records that are related to the
ContactsID, but only those that are "Ordered". This is usually done by
having extra fields that combine the necessary multiple data.

In the Contacts table you need a new field that combines the Contact ID
with the wanted "Ordered" data. Since it doesn't need to change for an
individual Contact, this one can be a Calculation field or a normal field
with an Auto-enter by Calculation option.
e.g.
OrderedPortal_Parent Text or Calculation (in Contacts table)
= ContactID & " - Ordered"

The problem is that on the child / right-hand side of a relationship you
cannot use a Calculation field to achieve this, so instead have to use a
normal field with an Auto-enter by Calculation option
e.g.
OrderedPortal_Child Text (in Orders table)
Auto-enter by Calculation
= ContactID & " - Ordered"

You can then create the relationship to match these two fields.
i.e.
rel_OrderedPortal
match records in Contacts Table with records in Orders Table
when Conatcts::OrderedPortal_Parent = OrderedPortal_Child

and create the appropriate portal on the layout.

But, because it is an Auto-enter by Calculation field, it will not update
itself when the Order is changed from "Ordered" to "Shipped". That means
you will also then need to use a script to change this field.
i.e.
change OrderedPortal_Child to
= ContactID & " - Shipped"

That should do what you want.



BUT, you can take this even further. Once this has been set-up you can
actually re-use the same portal / relationship to display any grouping of
the related Orders' records - just the "Ordered" ones or just the
"Shipped" ones - by simply changing the Contacts table
OrderedPortal_Parent field data. (In this case you may want to use a more
relevant name for the fields and relationship though since it's no longer
just Ordered records.)
e.g.
set OrderedPortal_Parent to ContactID & " - Ordered"
-> the portal displays related "Ordered" records

set OrderedPortal_Parent to ContactID & " - Shipped"
-> the portal displays related "Shipped" records

You can also use the same portal / relationship to display ALL the related
Orders records by making use of FileMaker's multi-key relationship
abilities.
e.g.
set OrderedPortal_Parent to both ContactID & " - Ordered"
AND ContactID & " - Shipped" (separated by a carriage return)
-> the portal displays ALL related records

This means you can have a pop-up menu (usually a Global field) above the
portal that the user can set to change what the portal displays - the
pop-up menu's data is used in the OrderedPortal_Parent field, in which
case it now needs to be a Calculation field.
e.g.
OrderedPortal_Parent (in Contact table)
Calculation, Unstored, Text Result
= ContactID & If (g_PopUp = "All";
" - Ordered^P" & ContactID & " - Shipped";
" - " & g_PopUp)

where ^P is really the "backwards P" carriage return character.

The g_PopUp menu field needs to have a value list of just three items:
All
Ordered
Shipped
and can be formatted as a pop-up menu, pop-up list or even radio buttons
(you could use check boxes, but it gets a little messier with multiple
possible values).

Then when the user changes the g-PopUp menu field from "Ordered" to
"Shipped" and the portal changes what it is displaying from the "Ordered"
records to the "Shipped" ones. It saves the need to have multiple
relationships and fields, and multiple layouts / tab controls - you can
use the one portal tab control you already have listed above for "1) a
list of all the Orders in descend chronological order".


Helpful Harry )

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.