2 Replies Latest reply on Jul 31, 2015 2:30 PM by DaveArndt

    new record go to field


      I have a script trigger "OnObjectKeyStoke" tied to a number field.  The script creates a new record if "Enter" or "Return" is pressed.  That part works fine the new record opens but you have to click in a field to start typing.  I was hoping when the new record opens the first field is selected and ready to just start typing.  Currently it opens a new record but you have to press Tab or click in a field.  This seems simple not sure what Im doing wrong.

      I added the "Go To Field"...didnt help.  I then tried adding a pause before it goes to the field which sort of works, the target field is highlighted for the duration of the pause then the active field moves to the next field.


      Thanks in advance



      FMP 13/14

      FMS 13
      Windows Environment (please be kind)





      If [Code (Get (TriggerKeystroke )) = 10 or Code (Get(TriggerKeystroke)) = 13

            New Record/Request

            Go to Field [FuelLog::VehicleNumber]

      End If


        • 1. Re: new record go to field

          It should work (it does on a Mac), though you should leave the script with Exit Script [ False ] to suppress the keystroke you left the field with – otherwise it is entered into the target field.


          On the other hand, if you


          • set the Field to “Go to next Object using" Enter and Return

          • use OnObjectExit, and

          • define the target field as first field in the Tab order

          you'd only need a single step in your trigger script (or that part of it) – namely, New Record.

          • 2. Re: new record go to field


            thanks your suggestion of ending the script with Exit Script [False] fixed the problem.  Im now going to implement your other suggestions.

            thanks again