4 Replies Latest reply on May 7, 2017 12:30 PM by tays01s

    Go to object (tab)

    tays01s

      I'm running an Import record script via a button on a different layout that includes 'Freeze' at the beginning and ends with:

       

      Set Variable [ $$Cancel_StayOnTab; Value:1 ]

      Go to Layout [ “Home_U” (Home) ]

      Pause/Resume Script [ 0 ]     Effectively to unfreeze
      Go to Object [ Object Name: "tab_patient" ]

      #Cancal the 'Cancel Stay on Tab'.

      Set Variable [ $$Cancel_StayOnTab; Value:0 ]

       

       

      I'd like to land on 'Home_U' layout and the 'tab_patient' (already the preferred tab). However, there's no movement to the 'tab_patient'.

        • 1. Re: Go to object (tab)
          Jason Wood

          Are you sure the object name of the tab is "tab_patient"?

           

          Is there a script trigger on the tab panel?

           

          Why do you have the variable - $$Cancel_StayOnTab - it doesn't seem to be doing anything.

           

          Pause/Resume Script [0] should work for unfreezing the screen, but the regular and more deliberate way to do this is the "Refresh Window" script step.

          • 2. Re: Go to object (tab)
            tays01s

            Apologies I 'thought' but didn't type some info.

             

            Yes, the object 'Patient' tab is called "tab_patient".

             

            There's an 'on exit' script trigger that keeps the focus on either of 2 tabs (Patient or Calc) if certain fields are empty. This script exits if $$Cancel_StayonTab = 1, hence this line of text in the import script.

             

            Your mention of a Window reminded me that the layout's tab is in a specific window so I tried:

            #Cancel Stay on Tab'.

            Set Variable [ $$Cancel_StayOnTab; Value:1 ]

            Select Window [ Name: "FeedCalc"; Current file ]

            Go to Object [ Object Name: "tab_patient" ] #Cancel the 'Cancel Stay on Tab'.

            Set Variable [ $$Cancel_StayOnTab; Value:0 ]

             

            ...and it appears to work as planned. Thanks for the input.

            • 3. Re: Go to object (tab)
              BruceRobertson

              I would think you'd want to cancel stay on tab before attempting to move off the tab.

              Though of course; we don't have much info about your setup.

               

              Set Variable [ $$Cancel_StayOnTab; Value:1 ]

              Select Window [ Name: "FeedCalc"; Current file ]

              Set Variable [ $$Cancel_StayOnTab; Value:0 ]

              Go to Object [ Object Name: "tab_patient" ]

              • 4. Re: Go to object (tab)
                tays01s

                In another script, I needed to do exactly that. But your point made me realise that other changes I'd made, made both those steps redundant. The reason is that the 'Import' button_script is on another Window of a different layout. So the above script now works without those script steps.  Thank you; both of you made me think of the context.