4 Replies Latest reply on Oct 14, 2009 10:34 AM by DaisyK

    Controlling portal row



      Controlling portal row


      Customers may have more than one shipping address which is in a separate table linked by customer key. Each address has a title (home, shop, business, etc.) On the customer page I display the shipping address in a portal, but only have room to display one address. I would like to also display a list of the shipping address titles for the customer, which could be clicked to show a specific address - it would also indicate to the user how many addresses are in the system for that customer.


      I have tried to display the list in another portal and have a script trigger to select an address, but it doesn't effect the address shown in the other (one row) portal.


      How can I make this work? thank you for your help.

        • 1. Re: Controlling portal row

          Presumably you have the following relationship linking these two tables:


          mainTable::CustomerID = Addresses::CustomerID


          Add an AddressType field to your main table and then update your relationship:

          mainTable::CustomerID = Addresses::CustomerID AND

          mainTable::AddressType = Addresses::AddressType.


          Now format the mainTable::AddressType field as a drop down or pop up of address types and your portal will show the address of the selected address type.

          • 2. Re: Controlling portal row

            I added the relationship as you suggested, but the mainTable::AddressType list shows all the Address types of ALL the customers, not only the addresses that the selected customer may have.


            Also, the addition of the second relationship causes the addresses not to display correctly in the portal.



            • 3. Re: Controlling portal row

              Please explain what you mean by "causes the address not to display correctly". No data shows before you select an address type? No data after you select? Wrong data entirely?


              If you want to limit your list of address types to just those for the current customer, you can set this up as a conditional value list. There's a "show only related values starting from" option in the value list setup dialog. Select this option and then select your main table as your "starting from" table (drop down menu just to the right of this option.)

              • 4. Re: Controlling portal row

                I solved it myself. I have displayed address type only in a second portal that displays several rows so it shows a list of the address types for the customer. There is a script trigger "on enter" in that portal that finds the portal row of the clicked address title. Then that portal row is selected in the 1-row portal that shows the whole address. The script steps are:

                1 - Set Variable [$row; Value:Get (PortalRowNumber)]

                2 - Go to Object [Object Name: "Address portal"]

                3 - Go to Portal Row [Select; No dialog; $row]


                It works like a charm. The user sees a list of the titles of the addresses for that customer which are in the system, and when one is clicked, the address window displays the address.


                Thank you for listening....