2 Replies Latest reply on Feb 19, 2017 1:45 PM by philmodjunk

    Launch a script with CR and related Tab Questions


      When setting Tab order you can TAB to an object, in this case a button, but you then have to click on the select button to launch the script.


      Is there a way to launch the script with the next CR, or enter?  It would be nice if the user did not have to leave the keyboard and go to the mouse to click  the button he just tabbed into.




      Is there a way to define a different TAB or based  on Window Mode?


      For example.  When creating a new Purchase Order the first field is a drop down for Select a Vendor.  But when in FIND mode it would be nice to have the first field be the PO Number.


      Yes, I know I can script based on MODE CHANGE to go to the PO number field.  But this is just one of many tab order changes I would make if I could and I would rather not have to right a navigation script for each field.


      And Another Related TAB question.


      Back to my Purchase Order example.  When a user tabs out of the last field, or a field with no tab order defined,  it jumps to the FIRST tab field.  This is a problem.   Can I set the layout to NOT tab to the first field in these situations.


      Currently I set a blank object tin the upper left corner of the layout as TAB 1.

        • 1. Re: Launch a script with CR and related Tab Questions

          get(windowMode) will tell you if you're in browse mode (result = 0) or in find mode (result = 1)


          tab order is by definition circular so when you tab out of the last field in tab order you will land on the first field in the tab order.


          But you can put a trigger on the last field, firing on onObjectExit, consisting of just Exit Script (false), to stop the cycling.


          If you include buttons in your tab order, they will be tabbed into and a CR will "click" them.

          • 2. Re: Launch a script with CR and related Tab Questions

            You can also use script triggers that perform scripts that put the focus on different layouts depending on conditions, such as windowmode, that you have your script check.


            Both go to field and go to object can be used to set the focus on a layout object.


            I would use onObjectKeystroke to check for specific keys inorder to intelligently change focus. That way clicking something doesn't trip the trigger. And you will need to use Ecut Script [False] to keep the tab/enter/return key that tripped the trigger from being processed or you won't get the focus where you want it.