8 Replies Latest reply on Apr 10, 2013 3:08 PM by philmodjunk

    OnLayoutExit and portal context

    callmedave

      Title

      OnLayoutExit and portal context

      Post

           I found the following two year old post here:

      "Go to related record" does not consider the portal filter, in combination the script trigger...

           that addresses the issue I came here looking to solve:

      "...if you have the script trigger "onLayoutExit" defined on the layout, the context will always be the record and never the portal..."

            

           Can someone tell me why I can't GTRR from a Portal Row if I have this script trigger on the layout?

           Or if there's any way around it?

            

           Thanks!

        • 1. Re: OnLayoutExit and portal context
          philmodjunk

               The discussion in that thread isn't very clear. It's documenting a very specific situiaton.

               a) you have a portal on your layout

               b) You have a portal filter defined that reduces the number of related records displayed in the portal

               c) you have an OnLayoutExit Script Trigger

               Without C), if you put the focus into a specific portal row and perform GTRR, you get a found set of only the recors shown in the filtered portal. If you do not have the focus in the portal row, you get all the related records--what you would see if there were no portal restricting the number of records visible in the portal.

               Apparently, (I have no more access to reasons why FileMaker was designed to work the wayt it does than you do.), the OnLayoutExit trigger causes the focus to change from the portal row to the layout and thus the portal filter has no effect on the records that come up in your found set--you get the set of records that would appear in the portal if there were no filter.

          • 2. Re: OnLayoutExit and portal context
            callmedave

                 My experience has no b) at all; simply put, on a regular unfiltered portal I cannot GTRR from a portal row's context when the OnLayoutExit trigger is in place (even with a script devoid of even a single Script Step). 

                  

                 I can GTRR into a new window, but that breaks my navigation protocol. Of course not having the trigger breaks my navigation options, too.

                  

                 Shouldn't this be documented somewhere?

            • 3. Re: OnLayoutExit and portal context
              philmodjunk

                   Then your situation does not match the thread that you referenced. If there is no portal filter, this is a different issue.

                   When I test GTRR with an ONlayout exit portal and GTRR, but no portal filter. It works just fine.

                   IF this is in a script that you are using it may help to post the exact script.

                   To post a script to the forum:

                     
              1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
              2.      
              3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
              4.      
              5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              6.      
              7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
              • 4. Re: OnLayoutExit and portal context
                callmedave

                     Thanks for your continued interest, Phil.

                      

                Then your situation does not match the thread that you referenced.

                     Not completely, other then the text I quoted in my origial post matches the experience I'm seeing. 

                      

                When I test GTRR with an ONlayout exit portal and GTRR, but no portal filter. It works just fine.

                     Then that's hopeful. 

                      

                IF this is in a script that you are using it may help to post the exact script.

                     No scripts; the portal row button uses the built-in button GTRR step, and the ScriptTrigger is attached to a script with no steps; completely blank.
                      
                     Attached is a relationship graph that exhibits this behavior.
                      
                     Layout is based on Tester, portal is based on Evaluations.
                      
                     Portal rows contain a foriegn key that matches the related primary key in the Products table.
                      
                     Button says GTRR from Products.
                      
                     With no trigger it matches the one Products record based on _kp_product_id=_kf_products_id_match
                     With any trigger the GTRR is evaluated as if I were starting at Testers, showing the many records matching _kp_testers_id=_kf_tester_id_match
                     (depending on which row you are on when you try it might look as if it were successful, as the first record will match correctly)
                      
                     Is there something wrong with my relationships? I'm not an expert with the whole parent/child thing, but I thought it was suppsed to work this way...
                      
                • 5. Re: OnLayoutExit and portal context
                  philmodjunk

                       In databases, the devil is in the details.

                       What you have here may match the results but not the context. Therefore it does not apply to this specific aspect of GTRR.

                       What you described is not what I tested and is even further different from that of the original thread you referenced than I thought. I worked from this relationship:

                       Parent-----<Child

                       where a Portal to Child was placed on the Parent layout. A GTRR button in the portal row was set to pull up a set of Child records on a layout based on Child, not a third set of records in a table related to child. In that context--which matches that of the original post, the OnLayoutExit trigger interferes with the portal filter affecting the found set produced, but without the filter, there is no observable difference in the results when you remove the script trigger.

                       Testing your exact scenario, I get interesting results. OnLayoutExit definitely interferes with the results, but what interesting results! I get a found set corresponding to all the records shown in the portal rather than the one related record of the row where I clicked the button.

                  • 6. Re: OnLayoutExit and portal context
                    philmodjunk

                         I have figured out a work around for this issue:

                         Write a script.

                         In that script, use two GTRR steps. GTRR 1 pulls up a found set of records for Evaluations.

                         GTRR 2 then pulls up the related Products record.

                         You are welcome to switch over to Report an Issue and describe this issue as a possible bug.

                    • 7. Re: OnLayoutExit and portal context
                      callmedave

                            

                           

                      I get a found set corresponding to all the records shown in the portal rather than the one related record of the row where I clicked the button.

                            

                      Which is the same as you get if you drag the button off the portal and onto the layout; I'm glad I'm not crazy!

                            

                            

                           

                      I have figured out a work around for this issue:

                           Thank you for that, works even when the trigger is in place on Evaluations, too. 
                            
                           I can't imagine FileMaker doesn't know about this behavior, but I'll see about reporting it.
                            
                           Thanks again for your input!
                            
                            
                      • 8. Re: OnLayoutExit and portal context
                        philmodjunk

                             Reporting it also sets in motion an opportunity for FileMaker to publicly acknowledge it. Then I get to document it in the Known Bug List.