Go Back / Forward script
I am having trouble trying set up a forward and back button on each layout that will take the user to the previous layout or the next.
Set up buttons with Go To Layout (Specify Layout Number by Calculation) = Get(LayoutNumber) - 1 to go back, +1 to go forward, always assuming that the order in which they are listed is the order in which you want them...
Although why you'd want to give this control to a user I'm not sure - they might find a layout you wouldn't want them to have access to...are you sure you want to do that?
Or have global fields that stores the layout names (forward and back) [ Get ( LayoutName ) ]
Then use: Go To Layout ( Name by Calculation ) with the global field content in a script that would re-record the layoutnames. By this method it is possible to have more control on which layouts the user is allowed to go. Sometimes I don't set the global layout name if I don't want the user to go to the previous layout, and have the possiblity of sending a message to the use they aren't able to do that.
You can also use a a global variable for this:
Go To Layout [$$LayoutName]
It requires that you use this script step: Set Variable [$$LayoutName ; Get ( LayoutName )]
Each time you change to a new layout. The OnLayoutEnter trigger can be set on each layout for that.
You can even "stack" the layout names in this variable ( or IT_User's global field ), to list all previous layouts that were visited and your script can "pop" one layout name at a time off the stack when going back and your OnLayoutEnter trigger can "push" one such layout name onto the stack each time you visit it.
Retrieving data ...