4 Replies Latest reply on Aug 1, 2012 8:54 AM by LyndsayHowarth

    How to make a parent and child portal work?

    tjtalusan

      So I have 2 tables which is a parent and a child table and they are related to an ID which is 1 to many respectively. So i setup the 2 portals in the layout 1 for the parent and 1 for the child. The idea is all the items I will add in the parent will be part of a dynamic dropdown list with the child portal. My only issue here is that, every time I add an item to the child it only refers to the first record in the parent portal(table).

      How can I make the child portal refer to the dynamic dropdown list and use that as an ID in my child table? And also do a count or sum for that specific parent ID.

      Below is an example on what I would like to achieve.

       

       

      Parent:

      IDCustomerTotal Orders
      1Acme15
      2Sierra8

       

       

       

      Child

      CustomerItem
      Order Qty
      AcmeApple10
      AcmeBanana5
      SierraApple8

       


      Thanks in advance!

        • 1. Re: How to make a parent and child portal work?
          LyndsayHowarth

          You need a join table in between when you have many to many relationships. I don't really think your example has much in the way of many-to-many relationships.

           

          In fact, in the example above you need 4 tables really.

           

          Customers

          Products

          Order (Invoice)

          OrderItem (InvoiceItem)

           

          One customer can have many invoices and each invoice can have many items ordered. Products is a reference table where the price of the items is looked up when entered in the OrderItem record. An Invoice is a 'holder' of multiple items.

          At no point would an invoice have many customers or an orderitem relate to many orders.

           

          HTH

           

          - Lyndsay

          • 2. Re: How to make a parent and child portal work?
            tjtalusan

            Which tables will be linked to the 2 portals? I want my data entry to be in the portal itself both for the parent and the child based on my example. Thanks

            • 3. Re: How to make a parent and child portal work?
              tjtalusan

              This is the actual file that I am working on. All entries on the parent will be a reference to the child portal below. All quantity will be totaled and will be displayed under Dispatched in the parent portal.

              Screen Shot 2012-08-01 at 11.42.54 PM.jpg

              • 4. Re: How to make a parent and child portal work?
                LyndsayHowarth

                Well... that all depends on the perspectives you want to take.

                 

                You may want to be able to enter invoices & invoice-items from the customer record

                or

                from the invoice enter lineitems and the customer all in the same layout....

                ..... many ways to do the same thing.

                 

                Relationships are never single one-size-fits-all scenarios. You may end up with relationships like:

                • Customer-Invoices, Customer_Invoices_Overdue, Customer_Invoices_Paid

                • Product-Invoice-Items might show data about purchase of a product found on many Invoices.

                 

                I suggest you look closely at the Invoices template files from your starter documents (New From Starter Solution).

                - Lyndsay