4 Replies Latest reply on May 30, 2012 8:11 PM by hobbiesdeveloper

    Portal to Portal Relationship Issue

    hobbiesdeveloper

      Title

      Portal to Portal Relationship Issue

      Post

      Hello,

      I have currently added two different Portal Fields inside a layout called "Shipping Center" which is under the ShippingCenter Table. The first portal that I have shows all the orders that are in processing state and the second portal shows all the order line items.

      The problem that I'm facing is with the second portal field not displaying the order line items for a selected order in the first portal field.

      Does anyone know how to make the second Portal field change it's data list depending on the portal row selected in the first Portal Field?

      Thanks.

        • 1. Re: Portal to Portal Relationship Issue
          philmodjunk

          This is sometimes called a master detail relationship.

          You should have a field in your orders table that uniquely identifies each order record such as an auto-entered serial number field. I'll call it OrderID.

          You should already have this relationship for filling in the lineitems for an order:

          Orders::OrderID = LineItems::OrderID

          If you have all that, you can define this relationship:

          ShippingCenter::gSelectedOrder = SelectedOrderLineItems::OrderID

          Where gSelectedOrder is a field with global storage specified and SelectedORderLineItems is an occurrence of the lineitems table created by selecting LineItems in Manage | Database | relationships and clicking the duplicate button (Two green plus signs). You can then double click the new occurrence to open a dialog box where you can rename it as I have here.

          Then you can either put a button in the Orders portal or select the fields in the portal row and use button setup to turn the entire row into a button. Either way, have the button perform this script:

          Set Field [ShipingCenter::gSelectedORder ; OrdersPortal::OrderID]
          Commit Record

          Make your second portal a portal to SelectedOrderLineItems.

          • 2. Re: Portal to Portal Relationship Issue
            hobbiesdeveloper

            Wow, Amazing. Never knew you can do that between portals.

            Worked like a charm.

            Thanks again PhilModJunk.

            Very greatful for all your help!

            • 3. Re: Portal to Portal Relationship Issue
              philmodjunk

              The next step would be to use conditional formatting with this type of expression:

              ShipingCenter::gSelectedORder = OrdersPortal::OrderID

              To highlight the most recently clicked portal row in your OrdersPortal so that you know which order's line items are currently displayed.