6 Replies Latest reply on Aug 26, 2016 1:47 PM by JonathanCoulter

    Refreshing a Portal


      I'm working on a solution to display order information for a customer.  There are two portals on the layout.  In the upper portal data from the order header table is shown.  In the lower portal are the line items details from the order detail table.  The idea is the user can click on a row in the orders portal and have the details show in the lower portal.  However, I cannot figure out how to get the lower portal to update.  I'm using the order number in the upper portal as a button to trigger a script to update the lower portal.  Currently I'm using Refresh Portal, but as I said, ain't working.  When I first load the record, the details portal shows the details for the first order in the orders table (which is fine).  Just can't get the two to stay in sync.



        • 1. Re: Refreshing a Portal

          Can you please post the script you are using in the button in the upper portal? Normally that script would set a field with the order ID and then a relationship would be built from that field to the Line Items table.


          Also, please indicate which fields are used in your current relationship between the Order table and the LineItems table.

          • 2. Re: Refreshing a Portal

            Are you passing the Object Name of the second portal when you call the Refresh Portal step? If Object Name is not specified, Refresh Portal refreshes the active layout object.

            • 3. Re: Refreshing a Portal

              The script only has one line: Refesh Portal [Object Name: "Order_Details"] ... Order_Details is the name of the Details portal.


              The upper portal (Orders) lists all open orders for the customer.  The lower portal (Details) lists the line item details for whatever order is selected from the Orders portal.  The relationship uses the sales order number field (sono).


              The relationship is working because the line items are being displayed correctly for the first order in the list.  It's when I select a different order that the Details portal is not being refreshed.  Probably something simple right in front of my nose ... just not seeing it.



              • 4. Re: Refreshing a Portal

                Just because it looks like it is working, doesn't mean it is working the way that you think it does.


                When working with related records, FileMaker defaults to showing the first related record. This is likely why you are are seeing the details for the first order.


                In your Orders portal, change the script to set a global field in Orders to the selected Order ID. Then have a table occurrence that connects the global selected order ID to the order ID in the Details and base your lower portal on that table occurrence.


                What is the base table occurrence for the layout, if both Orders and Order_Details are portals?

                1 of 1 people found this helpful
                • 5. Re: Refreshing a Portal

                  I'm attaching a small demo that shows you what I mean.

                  • 6. Re: Refreshing a Portal

                    I was able to get it to work, thanks.  I had to throw in a refresh window command, but it does what I want.


                    Appreciate the help!