Sometimes a project needs to change its startup windows depending on who logged in, what security roles they have, or what computer the Client is launched on. In these cases, rather than setting a static startup window, you can write a Client Startup Script that uses the system.nav library to open a dynamic set of windows based on hostname, IP address, user who logged in, and more.
This means you will remove the Open on Startup option from some or all of your windows and use a Client Startup Script to determine which windows will be opened. Typically, you will set your navigation window to Open on Startup, but decide on a main window in the startup script. The example below checks the users role before opening a window.
Code Snippet - Client Startup Role Check
# Checks the users role and opens a main window depending on the role
# Grabs a list of the users roles
roles = system.security.getRoles()
# Checks if they have Administrator role
if 'Administrator' in roles:
# Checks if they have Operator role
elif 'Operator' in roles:
# If they have neither Administrator or Operator