7 Replies Latest reply on Aug 14, 2014 2:44 PM by AppGuy

    GTRR Not working !!??

    AppGuy

      Title

      GTRR Not working !!??

      Post

           OK folks... I need to know if I am just going crazy or what..

           On the second part of my script in the attachment I have a GTRR step.  This does not work occasionally and wanted to know if anyone else if experiencing this??

           This 1st GTRR works fine... I go to all the related records..  Loop through those...

           Then want to go back to the parent related record to mark it...  but no go!!

           I am using UUID for PK's.. I have compared ID's and they match..

           Relationship is good...   Timecards::_pk_ID --> EmployeeTime::_fk_TimeCards

           The weird thing is sometimes it works, other times NOT...  I can't seem to find anything wrong..???

           I even ran the script with admin privileges.. Nada..

           Everything is on the latest version.. 13 across the board and completely updated...

           Is this an undocumented feature??  LOL :)

            

      Screen_Shot_2014-08-14_at_8.51.34_AM.png

        • 1. Re: GTRR Not working !!??
          SteveMartino

               I would venture a guess that it appears that it works sometimes/not works sometimes depending on which type of record it finishes on after step 13.

               Little confused about the script. 

               You start on a parent record...which is I guess an employee?

               You go to their related record of timeslips?   Loop thru, if they are signed, ok, if not mark as 'No Signature'.

               Then what?  Do you want to see a list of all that employee's  time slips that are not 'No Signature' and Check a box?

               Then what do you want to do?  Do you want to go to the next employee? Or back to the current employee?

               If back to current employee...In the first GTRR, you could put it in a new window.  Then when you are done, just close that window and you're back to the first window, with the same employee, and the same current found set.

               If you want to move to the next employee, you would need a loop within a loop.

                

          • 2. Re: GTRR Not working !!??
            AppGuy

                 The TimeCards TO is where I store all the basic info about the timecard..

                 Then I have an EmployeeTime TO that has all the time entries for employees.

                 The script starts out on the Timecards TO...   GTRR --> to the EmployeeTIme...  To check and see if all the time has been signed...  This is where I loop through all the time and check for signatures..

                 If all the employeetime is signed then I go back to the TimeCard   GTRR--->TimeCards to mark it as been signed.

                 I am only doing this once the employees are done filling out their time..

                  

            • 3. Re: GTRR Not working !!??
              philmodjunk

                   The most common failure for GTRR is for there to be no related records to go to for the current record and the relationship specified in the GTRR step. (The relationship will be the relationship from the current layout's table occurrence (See "Show Records From" in Layout Setup...) to the Table occurrence specified as the "Table" inside the GTRR step.

                   When there are no related records, no error message interrupts your script and the script does not change layouts, in otherwords, except for an error code returned that you can check for with Get ( LastError ), the script executes as though the GTRR step did not exist!

                   So you normally need to either test for the existence of a related record just before you do the GTRR or you check for that error code immediately after the GTRR. (And if using the "Match found set" option, it's best to check Get (LayoutName) to see if the layout changed.)

                   For more on GTRR: The Complete Go To Related Record

              • 4. Re: GTRR Not working !!??
                AppGuy

                     Phil-

                     The problem is this is sporadic.  I don't understand why this would work sometimes, but not others...  I have verified UUID's and Relationships are all good..  

                     Everything is there and should work...  It's almost like it does not realize it's a related record..   Even though the UUID's match..  and the 1st GTRR works..

                     It almost seems like a bug..   

                • 5. Re: GTRR Not working !!??
                  philmodjunk
                       

                            The problem is this is sporadic

                       Which is exactly in line with what I am describing. If your current record, the last record in your found set has related records from TimeCards linked to it, it works. If, the next time that you run your script, the last record in your found set does not have any related records in TimeCards, it will fail.

                       This will be the case even though all your relationships are correctly set up as this is an issue with your Data, not the relationship definitions.

                       I strongly recommend that you add a check for related records here as this will tell us if I am guessing correctly as to the cause of this issue.

                       Another possible cause of such a periodic failure is a damaged file and/or damaged index. You might recover a copy of this file and test the recovered copy to see if it still shows this issue. I'd explore this option if changing your script to check for related records does not keep the script from failing.

                  • 6. Re: GTRR Not working !!??
                    SteveMartino
                         

                              The script starts out on the Timecards TO...   GTRR --> to the EmployeeTIme...  To check and see if all the time has been signed...  This is where I loop through all the time and check for signatures..

                         

                              If all the employeetime is signed then I go back to the TimeCard   GTRR--->TimeCards to mark it as been signed

                         Your script wont do this if you have 1 record where the all the time is signed, and one where it is not signed.  Like I stated earlier.   Line 14 only evaluates the last record in the loop, not the entire set of related records.  What should happen if you have 1 record signed and one record not signed.

                         I also think this points to the question:

                         

                              The problem is this is sporadic.  I don't understand why this would work sometimes, but not others...  

                         Did you try looking at it on the data viewer with the script debugger running?

                    • 7. Re: GTRR Not working !!??
                      AppGuy

                           Steve / Phil -

                            

                           Thanks for both of your feedback and suggestions...  I finally found out where the issue was...  The users can add timecards from several places in the app.

                           My check for signature script above was only firing off on the last timecard...   so if the user add 4 timecards... only the last one was getting checked..  Got it fixed now!!! WOOT!!

                           Thanks!!  :)

                           JP