1 Reply Latest reply on Aug 12, 2009 8:43 AM by TSGal

    Execution sequence of Single step vs. Script for Button Setup

    ajmiller

      Title

      Execution sequence of Single step vs. Script for Button Setup

      Post

      I use FileMaker Pro 10

       

      I have a layout (Layout A) used in list view that displays a list of records. Clicking on a row in the list clicks a transparent button that opens that record on a different layout (Layout B) using form view. I have On Record Load triggers set on both layouts. When I click a record in Layout A I expect the On Record Load trigger of Layout A to execute first, then switch to Layout B, and then have On Record Load in Layout B execute.

       

      However, if the button uses a single step (either Go to Related Record or Go to Layout) the single step runs first and then the On Record Load of Layout A is triggered after the layout has switched to Layout B followed by On Record Load of Layout B. On the other hand, if I have the buttons on layout A do Perform Script on a script that contains a Go to Related Record step, I get the expected behavior. 

       

      The button behavior with a single step is surprising to me. Is there any documentation on the ordering of button actions and triggers? 

        • 1. Re: Execution sequence of Single step vs. Script for Button Setup
          TSGal

          ajmiller:

           

          Thank you for your post.

           

          The OnRecordLoad triggers a script to run after going to a different record.  It is a "post-event" trigger so the script doesn't execute until after the trigger action is completed.  In this case, the click on the button and the button's action.  The script is "queued" and will run after any previously queued scripts, but other button actions or user actions will be handled first.  Therefore, if the button goes to a different layout, that action will be executed first before the OnRecordLoad script trigger executes.  However, if the button calls a script, that script is queued as the OnRecordLoad script trigger  then executes.

           

          TSGal

          FileMaker, Inc.