Trigger script at startup

Basically you change the page navigation to history arrows showing an 'agreement or welcome' page with an OK button that triggers your startup script. Last line switches  back to tabs or step by step page navigation mode.

# change manually the page navigation mode to 'history arrows' to force user to click on the agree button

# --------------------------------------------------------
# your startup script goes here

# Example of a startup script:
# Requirement is to set row level security with embedded data, so 
# personalized info links are not an option. 
# We could get username from the system and store it on a document property
# and use the document property to limit the data by user
from System import Environment
Document.Properties['currentUser'] = Environment.UserName



# To limit the data by user on your visualization, we use a custom exprssion like this: '${currentUser}' = [user]
# The previous step could be scripted, but it is out of the scope of this post, so data limiting on a visualization by user is done manually for now

# Last step will be to move to the page of your choice and switch back to tabs
# --------------------------------------------------------

# Change to tabbed pages
Document.Pages.NavigationMode = Document.Pages.NavigationMode.Tabs
Previous
Next Post »