7 Replies Latest reply on Jul 2, 2013 8:23 AM by schamblee

    Repeated find/input for tracking data

    ChrisDeith

      Title

      Repeated find/input for tracking data

      Post

           Hi all

           I have a button on my main layout to open a tracking data input screen, with which I can search for a particular invoice and then add the tracking data.  The idea is to be able to loop through this process as many times as needed before closing the window.  I have a barcode reader to assist input (it adds a <CR> to the data to automatically move to the next field) but the idea is that the data can just as easily be entered manually via the keyboard with the return key used to enter the data and moved to the next field.

           I use the "Enter Tracking Data" code (see below) to open the window (also attached) ready for input which also runs the "Input Tracking Data" code (also below) which runs the find process.  

            

           And first run through, no problem.

           But once the tracking data has been input, I want to start again & find another invoice.  So I added the same "input tracking data" script to the "on exit object" trigger of the tracking data field to restart the process when the first record has been updated. when they've finished entering data, the user can click "done" to close the window.

           While the script runs fine the first time through, when it runs the second time - via the on-exit-object trigger, it:

           - clears the current data (correct)
           - returns to the invoice field (correct)

           BUT this time, when I enter another invoice number, instead of carrying out a find/moving to the tracking field/waiting for data input, it just loops straight back to the invoice field?

           Something very basic and simple I'm sure but I just don't seem to be able to find the answer??!!  blush

            

      Screen_Shot_2013-07-02_at_10.56.01.png

        • 1. Re: Repeated find/input for tracking data
          schamblee

               You don't need a loop, but you do need another button.  You need one button to close the Input Track Data Window, when the user is completely done.  You need another button to perform your find script. 

               1.  The user enter all information, then click find.

               2.  Edit the information and closes this window.

               3.  Goto Step 1 or click the finish button.

          • 2. Re: Repeated find/input for tracking data
            ChrisDeith

                 Hi Chamblee

                 Thanks for the reply; the "done" button closes the window, as you describe but I want to avoid a separate button to re-run the script as the idea is that this can all be done without keyboard input, providing the scanner adds a <return> character to the data.

                 Ie -

                 Scan the invoice (number is entered, return follows and data is found.  Auto-Tabs to the tracking field)

                 Scan the Tracking Data - data is entered, Layout Auto-Tabs to next field & in the process "exits" the Tracking Field Object, thereby triggering the {input trackind data} script again to start afresh with the next item.

                 >>back to next input [unitl] "Done" is pressed.  But while the script runs the first time, and triggers when it should on exiting the field, the second run through doesn't find the invoice data and sits in a permanent "find" loop....

            • 3. Re: Repeated find/input for tracking data
              schamblee

                   It wouldn't be possible.  You would be stuck in your find tracking data window the whole time, and would not be able to return to the prior data entry screen.   You can't have one button to be done with find and done completely with all finds.

              • 4. Re: Repeated find/input for tracking data
                ChrisDeith

                     Maybe I've confused the issue.  The only function of the "Done" button at the top of the "input Tracking Data" layout is to halt the script and close the input window when the user has finished all the entries.

                     If a second button on the same layout could re-run the script successfuly, I'm not sure I understand why I can't run the same script from a script-trigger instead?

                     thanks....

                • 5. Re: Repeated find/input for tracking data
                  schamblee

                       You need a button to perform the find.  You will also need a button to exit the find window.   If you use a onExit script trigger you will be stuck in that find window.   Each time you click done it would exit then reenter the windows.  

                       You could use a script trigger when exiting a field, but then you would have to enter and exit that field each time.

                       With more than one search field this could be problematic. One time you need to search on one field, then the next time on three fields, so you would have to click on the last search field to trip the exit field script tigger. 

                       Or just click a button to perform the find.  Either way you still are clicking. 

                       Unless your search alway uses the same number of serach fields each time then the exit field script tigger on the last search field would work.

                        

                        

                  • 6. Re: Repeated find/input for tracking data
                    ChrisDeith

                         There are only two fields.

                         The search is always on the invoice number field.  Data entry is only done on the tracking data field.

                         After entry of the tracking data, the requirement is always to return to the invoice field to do another search

                              - unless the user has finished searching and wants to close the window, in which case they click the "Done" button.

                         Does that help at all?

                    • 7. Re: Repeated find/input for tracking data
                      schamblee

                           Use a script tigger on the Tracking Data field to perform the find.