3 Replies Latest reply on Aug 6, 2015 8:22 AM by philmodjunk

    Portal Active Row and Field Reverts on Script Exit

    ScottBleackley

      Title

      Portal Active Row and Field Reverts on Script Exit

      Post

      Last two lines of script are
      go to portal row
      go to field

      When in debug, stepping through script, this appears to work correctly, till the script ends when active portal row reverts to what it was before we started.  

      sigh...  must be something really simple.

      Any suggestions are most welcome,
      thank you



       

       

       

       

       

        • 1. Re: Portal Active Row and Field Reverts on Script Exit
          philmodjunk

          Is this a script performed by tripping a script trigger?

          If so, which one?

          This sounds like expected behavior for a script trigger that performs the script before the triggering event is processed.

          • 2. Re: Portal Active Row and Field Reverts on Script Exit
            ScottBleackley

            ref for triggering events: http://www.filemaker.com/help/html/create_layout.9.48.html

            Yes, the script is triggered by tripping a script trigger

            On Save currently although I tried On Exit, of course both of those perform the script before the triggering event.
            But logically they are correct, On Modify in this case is not appropriate because we do not want to progress 
            to the next field until Tab or Next is selected, the field may be modified multiple times before this happens.

            So I tried On Enter, which performs script after the triggering event, for the target next field with a first entry condition
            that stops infinite regress.  But even here, if I go to field on the active portal row, it does not activate the field.
            No fields are active at this point so a Next or Tab starts at Tab order 1 again. Not what was intended.

            I should note that the initial script does include CommitRecords to sort rows in the portal, and includes a perform of a script that does a variety of searches and summaries using several other layouts before it finishes and returns.

            What I am trying to do is reposition to the correct row, and field which has now floated up in the portal.
            Perhaps there is a better way to do this than to Go To portal row and then Go To field.

             

             

             

             

             

             

             

             

             

             

            • 3. Re: Portal Active Row and Field Reverts on Script Exit
              philmodjunk

              OnObjectSave should not have this problem as it is an "after the event" script trigger. You sure that it has this problem.

              To keep the triggering event from being processed with a "before" trigger such as OnObjectExit, you can terminate your script with this script step:

              Exit Script [False]

              The "false" parameter cause FileMaker to skip processing the event that tripped the trigger--but only for "before" triggers.