2 Replies Latest reply on Feb 15, 2010 1:43 PM by dmpjporter

    Another Portal question



      Another Portal question


      I am finding out that portals are very usefel adn I am finding new uses for them just about every day. However, I am not always able to implement the new uses on my own.


      Here is what I would like to do. I would like to have an invoice with the portal for the line items, I actually already have this using a join table and it works great. But I would like to add another portal to the same layout that shows products available and have a user be able to click on the product to add it to the line items automatically.


      Is something that can be done?




        • 1. Re: Another Portal question

          Yes, you have to figure out the best set of tables and relationships that will work with your database to list the available products, but once you have that set up, a simple script can add the clicked item to your line items portal.


          Your script could be written like this:


          Set Variable[$Invoice ; Value: Invoices::InvoiceID]

          Set variable[$Item ; Value: ProductListPortalTableOccurrence::ItemID ]

          Freeze Window

          Go To Layout [LineItems (LineItems)]

          New Record / Request

          Set Field [LineItems::InvoiceID ; $Invoice ]

          Set Field [LineItems::ItemID ; $Item ]

          Go To Layout [Original Layout]


          Your Products available portal could be based on a relationship as simple as:


          Invoices::InvoiceID X Products::ItemID (the X operator is a "match all values" operator so all the records in products would appear in your portal.)



          • 2. Re: Another Portal question

            Thanks for the reply Phil, I am going to see if I can get it to work. It looks pretty straight forward but I will probably have some thinking to do.