This function is used in Python Scripting.


Attempts to switch the current user on the fly. If the given username and password fail, this function will return false. If it succeeds, then all currently opened windows are closed, the user is switched, and windows are then re-opened in the states that they were in. 

 If an event object is passed to this function, the parent window of the event object will not be re-opened after a successful user switch. This is to support the common case of having a switch-user screen that you want to disappear after the switch takes place.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax, password, event, [hideError])

  • Parameters

String username - The username to try and switch to.

String password - The password to authenticate with.

EventObject event - If specified, the enclosing window for this event's component will be closed in the switch user process. Refer to the list of Event objects. [optional]

Boolean hideError - If True, no error will be shown if the switch user function fails. Default is False. [optional]

  • Returns

Boolean - False if the switch user operation failed, True otherwise. 

  • Scope

Vision Client

Code Examples
Code Snippet
# This script would go on a button in a popup window used to switch users without logging out of the Client.
# Pull the username and password from the input components.
uname = event.source.parent.getComponent("Username").text
pwd = event.source.parent.getComponent("Password").text
# Call switchUser. The event object is passed to this
# function so that if the username and password work,
# this window will be closed before the switch occurs.
# If the login didn't work, give input focus back to the
# username component, so that the user can try again.
if not success:

system security switchUser, security.switchUser