3 Replies Latest reply on May 3, 2010 9:11 AM by ninja

    Help! LayoutAccess

    deltatango

      Title

      Help! LayoutAccess & ScriptTrigger

      Post

      I have created a script, that takes a parameter. When you run the script, it tries to go to that layout name based on parameter. If last error <> 0, then it goes back to the original layout and shows a custom dialog that says "You do not have access to this layout."

       

      The problem is that the second layout has an OnRecordLoad script trigger. So this is what ends up happening:

       

      1st Script

      Set Error Capture[On]

      Go to layout x

      2nd Script triggered by onRecordLoad

      Go to tab["abc"]

      End of 2nd Script

      If[GetLastError <> 0]

      Go to Layout[original]

      Custom Dialog["Error, you do not have access to that layout."]

      End If

       

      The problem is the Last Error in this case is the result of Going to Tab["abc"]. How can I catch the error BEFORE the script is triggered??? I guess by exiting the second script with result: false???