In InfoPath SP1, the order of processing at startup of a form is:
- User Roles
- Open Rules
- OnLoad event handler
- OnSwitchView event handler
The User Roles are processed first so that when the Open Rules are evaluated that they can take into account the current role. The Open Rules can be used to change the default view. Then, after these have processed, the OnLoad event handler will take over. At this point the View object doesn't exist and any functionality requiring it will fail. As a result, you cannot switch views at this point, but can change the default view. Lastly the default view is created and the OnSwitchView event handler is called.
©2004 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.