Displaying a view on Form Load in browser - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Displaying a view on Form Load in browser

Last post 04-12-2012 10:57 PM by Jo-Anne Alfafara. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-09-2012 02:05 PM

    Displaying a view on Form Load in browser

    Hello,

    I'm trying to display a view when I open my form but the following code only work in the InfoPath UI and not in the web browser.  Any suggestions would be greatly appreciated.

     I'm running this code in "FormEvents_Loading"

    e.SetDefaultView("View 2")

     

    Thanks in advance

  • 04-10-2012 08:42 PM In reply to

    Re: Displaying a view on Form Load in browser

    Hi yelanger,

    You can set the default view without code. Try editing the properties of the view and check the "set as default view" check box.

    Jo-Anne

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 04-11-2012 05:49 AM In reply to

    Re: Displaying a view on Form Load in browser

     Thanks Jo-Anne,

     I need to use code for this as I have several views.  The view that opens is determined by a web service that brings back a SQL record that contains a status.

     My problem is the Rules run before the code on load so I can't use the rules as my code has not yet determined the status.  The code I use does work fine in the InfoPath UI but just not the browser.

  • 04-12-2012 10:57 PM In reply to

    Re: Displaying a view on Form Load in browser

    Hello again,

    Why don't you try adding a rule on form load that switches to "View 2" and add a condition so that it only runs when status = "<your value>"?

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.