5 Replies Latest reply on Jun 3, 2009 3:32 PM by mrvodka

    Triggered script does not work...

    annacaltech

      Title

      Triggered script does not work...

      Post

      Hi,

       

      I am a trying to set up a triggered script that should be launched every time a record is loaded in layout 1. The script works fine as a button but when I try to put it to be triggered it launches the script and then the mouse turns into a ⌘. How can I figure out what is wrong?

       

      Thanks,

      anna 

        • 1. Re: Triggered script does not work...
          mrvodka
             Please post your script as well as what it is you are trying to achieve.
          • 2. Re: Triggered script does not work...
            annacaltech
              

            I am setting up a script that should take my field content from the first layout and go to a second table and search if it has related records there. If so, it should take another fields content from the second table and paste that in in a field in the first layout. I have gotten this to work as a button but not as a triggered script...

             

            The script:

             

            If[not IsEmpty(FREEZER::id#_ID)]  

                Set Variable [$ID#; Value:ID#::id#_ID]

                Go to Layout ["FREEZER" (FREEZER)]

                Enter Find Mode[]

                Set Field [FREEZER::id#_ID; "*"& $ID# &"*"]

                Perform Find []

                Set Variable [ $location; Value:FREEZER::location]

                Go to Layout ["MAIN SCREEN" (ID#)]

                Set Field [ID#::location in the freezer; $location]

            End If

            Exit Script[]

             

             

             

            thanks,

            anna 

            • 3. Re: Triggered script does not work...
              mrvodka
                

              I dont understand the point of doing this when you can just simply put the related field on the main layout.

               

              BTW, the reason why your script kept firing was because each time it went to the layout, it fired. In your script you go to that layout with the scrip trigger, so it got stuck in an endless loop.

              • 4. Re: Triggered script does not work...
                annacaltech
                  

                it is a long explanation why I need this...

                 

                 

                but lets say that I do need it... I can I make it not to start the script when I go back to the layout....?

                 

                thanks,

                anna 

                • 5. Re: Triggered script does not work...
                  mrvodka
                    

                  Okay so if you dont want ot put the related field of FREEZER::location on the Main layout, and for some reason you need to set the ID#::location in the freezer field, then you can just do: Set Field [ ID#::location in the freezer; FREEZER::location ]

                   

                   

                  But again this doesnt make any sense when there are multiple child records, as does your script since it will be on the first related record.