1 2 Previous Next 20 Replies Latest reply on May 7, 2017 4:09 AM by beverly

    Refreshing a Portal

    gfr92y

      I have a portal that I will call LIST OF CUSTOMERS. (Photos #1 & 2)

       

      My desire is to type the first few letters of a company's name in the global field CallReport::ChooseCustomer and click on a red square button (Photo #4) to populate the portal LIST OF CUSTOMERS with an alpha-sort of my customers' names starting with Customer2::CustomerName >= CallReport::ChooseCustomer at the top and ending with Zywux on the bottom.

       

      Everything works PERFECT except the portal does not refresh such that  Customer2::CustomerName >= CallReport::ChooseCustomer is listed in the first row of the portal no matter how many times I click on the red square button! (The top-left red arrows on Photo #3 signify repeated attempts to refresh the portal.)

       

      However, if I first click on any field, for example, in the field Additional Information shown on the right half of Photo #3, then I need only click on the red square button once for the portal to refresh and list the customer name satisfying Customer2::CustomerName >= CallReport::ChooseCustomer in the first row as desired.

       

      I would be grateful if someone can tell me how to changing my programming such that after typing the first 3 or 4 letters of the company's name in the global field CallReport::ChooseCustomer I could then click on the red square button causing the portal to refresh and produce the desired outcome.

       

      That said, it would be really cool if I could type "K" and K-Line, the first "K" company would be in the first row; type "L" and Kline would now occupy the first row; type "O" and Kloke would grace the first row.

       

      However, if the it too complicated for me to understand, using the little red square button is just fine.

       

      Thank you for any assistance you could provide me.

       

      Sincerely,

       

      Joe

       

      Portal6.png

      Relations6.png

       

      ButtonPush6.png

       

      ButtonStepUp6.png

        • 1. Re: Refreshing a Portal
          CarstenLevin

          If you are using an older version of FileMaker you should have a script trigger on the field refreshing the entire record. This will work but it is better in the latest versions of FileMaker.

           

          In FileMaker 14 you should use the "Refresh Portal" script step. If it is not a portal then use the "Refresh Object" (for conditional formatting etc).

           

          You shold name the portal after a good set of conventions, so that you are sure that you are refreshing the right portal:-) here I am just using the name [members_portal_01]

           

          This is much better than refreshing the entire window, much less data transferred, faster and intelligent.

           

           

          The script steps that will refresh your portal

          refresh.png

          Depending on your version of FileMaker you may have only the "Refresh Window". It will do the job, but if you have FileMaker 13 or 14 I strongly recommend "Refresh Portal".

           

          Naming your portal

          name2.png

           

          The script step as it should look (with your object name instead of [members_portal_01)

          step.png*

           

          * And you may ask, why the "01" after the portal object name?

          Because you may have more than one portal on the layout referring to the same TO.

           

          Hope that this is a help?

           

          Best regards

           

          Carsten

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

            Fm Pro Adv 13.0v3

            • 3. Re: Refreshing a Portal
              gfr92y

              Carsten,

              Great stuff!  Later this morning I will digest it and see how far it gets me.

              I will be back with praise or praise and questions.

              Thanks!

              Joe

              • 4. Re: Refreshing a Portal
                CarstenLevin

                Hi Joe,

                 

                Please shoot; I will be ready!

                 

                BTW: Which version of FileMaker are you using?

                 

                Best regards

                 

                Carsten

                • 5. Re: Refreshing a Portal
                  CarstenLevin

                  Btw, forgot the last the dumps:

                   

                  Right click on the field, select "Set Script Triggers ...".

                  trg1.png

                   

                  Choose when you want the script to be trigged and select the script you want to run. In this case the script updating the portal.

                  trg2.png

                  • 6. Re: Refreshing a Portal
                    DanielShanahan

                    I've not had much luck using Refresh Object or even Refresh Portal in similar situations.  However, Daniel Wood of Digital Fusion once wrote about adding a constant to the relationship.

                     

                    I have a field in every table called constant_1 and defined as Auto-Enter/Data: 1

                     

                    You can add these fields to your relationship TABLE1::constant_1 = TABLE2::contant1.  Again, add this to your existing relationship definition.

                     

                    Using a script trigger, add a line Set Field [ TABLE2::constant_1 ; 1 ]

                     

                    This should update the portal.

                    • 7. Re: Refreshing a Portal
                      mark_scott

                      DanielShanahan wrote:

                       

                      Daniel Wood of Digital Fusion once wrote about adding a constant to the relationship.

                       

                       

                       

                      And Daniel (Wood, that is) has recently updated his article for FM14.

                      • 8. Re: Refreshing a Portal
                        CarstenLevin

                        Hi Daniel,

                         

                        There may be situations where the portal refresh does not work, but in the situations where we have used it it seems to work fine. Maybe if the relations used by the portal is many TO's away?

                         

                        I would definitely start by using the Refresh Portal ... and only if this does not work I would try other methods.

                         

                        Best regards

                         

                        Carsten

                        • 9. Re: Refreshing a Portal
                          sicosys

                          I had a similar problem before and i went through the same situation trying to refresh the portal as i created new records.

                           

                          The way i solved the problem was easy... i just inserted the instruction "Commit Records/Request" at the end of the script.

                           

                          I hope this helps

                           

                          Felipe

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

                            Hi Philipe, you are right. If the data is not committed to the database it will not be reflected in the Portal.

                            • 11. Re: Refreshing a Portal
                              DanielShanahan

                              Thanks Mark.

                               

                              I didn't realize Daniel updated his article.

                              • 12. Re: Refreshing a Portal
                                DanielShanahan

                                Hi Carsten,

                                 

                                There may be situations where the portal refresh does not work...

                                Unfortunately, when it hasn't worked, I moved to the other method (TABLE1::constant_1=TABLE2::constant_1) because I know that works. 

                                 

                                What I'd like to do is stop development, fork the database, strip out the client data, populate it with fake data, move it to my test server (over the WAN), and try to figure out why it doesn't work.  But I don't.  I use something that works and keep moving on the client stuff.

                                 

                                When FMP 13 came out there was a new script step called Refresh Object.  I thought this would refresh the portal, since it says, "If the specified object is in a portal, Refresh Object updates the object in every visible portal row."  I thought that would allow a portal refresh without dumping the cache, but I was never able to make that work the way I expected (note that my expectation may be the problem and not the script step).

                                 

                                I found the same thing with Refresh Portal, but again, I haven't documented when it didn't work and spend the time to figure out why.

                                 

                                But you mentioned that you have used it and it seems to work fine, so it could be a PICNIC issue (Problem In Chair, Not In Computer).

                                • 13. Re: Refreshing a Portal
                                  gfr92y

                                  Carsten,

                                   

                                  I have FMPA 13.0 v3, but could not find REFRESH PORTAL. (Upgrading to FMP/FMPA 14 is not an option.)

                                   

                                  Do I need to update to a different version of FMPA 13.0 or do something else to make REFRESH PORTAL available in FMPA 13.0 v3?

                                   

                                  Thanks!

                                   

                                  Joe

                                  • 14. Re: Refreshing a Portal
                                    gfr92y

                                    Background: My desire is to type the first few letters of a company's name in a global field and click on a button to populate a portal with an alpha-sort of my customers' names starting with the first few letters typed in the global field. Everything works PERFECT except the only way to refresh the portal is to first click on any field before clicking on the button.

                                     

                                    To everyone who tried to help,

                                     

                                    I really appreciate your trying to help.

                                     

                                    Unfortunately, the cure will kill the patient long before the disease will; so to speak.

                                     

                                    I will continue to click on a field before clicking on the button and move on to slaying other dragons.

                                     

                                    Thanks again for all your help.

                                     

                                    Sincerely,

                                     

                                    Joe

                                    1 2 Previous Next