sandyinlet Posted June 3, 2009 Posted June 3, 2009 I've added a script trigger to a tab panel to check a global variable. If the variable is true, then bounce the user back to the tab object they were last in and provide a message. However the message displays twice. Here's the script in two variations: If [$$CurrentTab.People = "Addressing.Edit.Uncommitted"] Go to Object [Object Name: "Addressing.Edit"] Show Custom Dialogue ["Error"; "Error message.] Exit Script [] End If Displays the Addressing.Edit object, then displays the message, then displays the message a second time. If [$$CurrentTab.People = "Addressing.Edit.Uncommitted"] Show Custom Dialogue ["Error"; "Error message.] Go to Object [Object Name: "Addressing.Edit"] Exit Script [] End If Displays the tab clicked, then the message, then displays the Addressing.Edit object, then displays the message a second time. The Debugger seems to run just once, but when I add a counter to it, it does run twice. How can this be fixed? Appreciated.
bcooney Posted June 3, 2009 Posted June 3, 2009 Do you need the Exit Script [] step? What kind of trigger? OnObjectExit?
sandyinlet Posted June 3, 2009 Author Posted June 3, 2009 Solved the problem. Here's the script: If [$$CurrentTab.People = "Addressing.Edit.Uncommitted"] If [isEmpty($$Counter) Set Variable [$$Counter; Value: $$Counter + 1] Go to Object [Object Name: "Addressing.Edit"] Exit Script [] Else Show Custom Dialogue ["Error"; "Error message.] Exit Script [] End If End If
sandyinlet Posted June 3, 2009 Author Posted June 3, 2009 The trigger is On Object Modify. Because I have another similar routine which works. Will play with On Object Exit and see if that eliminates the double dipping into the script. Thanks. You're probably right, I don't need the Exit Script. Just habit.
sandyinlet Posted June 3, 2009 Author Posted June 3, 2009 Switching from On Object Modify to On Object Exit makes no difference. The script runs twice and the message is displayed twice. I think I've figured out why the script is running twice. First time it's on some other Object, goes to the required object, displays the message, runs again, finds it's already on the required object and displays the message a second time. Unfortunate trigger behaviour. Thanks anyway.
Recommended Posts
This topic is 5926 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now