2 Replies Latest reply on Jan 25, 2011 7:37 AM by DanielClark

    Relating tables/portals back and forth

    DanielClark

      Title

      Relating tables/portals back and forth

      Post

      I have three tables - Parts, Purchase Orders, and Line Items. Whenever I make a Purchase Order, I use a portal (linking to the Line Items table) and have a drop down list of items from my Parts table that I can add to the Purchase Order (and subsequently to Line Items). The Purchase Order has a key field _kp_PO_ID that is related to Line Items' _kf_PO_ID. Parts has a key field _kp_PartID which is related to Line Items' _kf_PartID. So:

      Purchase Orders::_kp_PO_ID>---<LineItems::_kf_PO_ID ; LineItems::_kf_PartID>---<Parts:_kp_PartID

      I want to be able to see, from my Parts layout, which PO's that particular Part was on. So If I add a part to my Purchase Order layout (via my Line Item portal), how can I have it automatically load that Purchase Order number in a portal to the layout of that Part which was added? I'd like to do this so I can see the different Purchase Orders that the part was ordered on (say if I had 10 Purchase Orders that featured that part, I'd like to be able to see all of them listed in the portal on my Part's layout).

        • 1. Re: Relating tables/portals back and forth
          Sorbsbuster

          (I think that your relationships are all actually, reading left-to-right, one-to-many, but you have drawn them as many-to-many.)

          If you start with the Parts Table and have relationships like this:

          Parts:_kp_PartID ---> LineItems::_kf_PartID --> and then LineItems::_kf_PO_ID --> Purchase Orders::_kp_PO_ID

          and then draw a portal in the Parts Layout based on the end of that relationship (Purchase Orders) and put the fields you want in the portal, does that not give you the list of POs you want?

          • 2. Re: Relating tables/portals back and forth
            DanielClark

            Ah I figured out what I was doing - I actually have another table occurrence of Parts in this relationship I'm using. The layout is for the first table occurrence - which isn't in that relationship.