425-882-1032 info@3sharp.com

The 2007 Microsoft Office release has built-in support for running InfoPath forms in a mobile Web browser. Granted, there are limitations to the form behavior. For instance, all formatting and layout in views are ignored, and controls such as the rich text box, option button, and section are not supported. Still, the fact that InfoPath form data can be submitted from mobile devices opens up a broad range of user scenarios.

You can enable form templates for rendering on a mobile device from the Form Options dialog box. Within the Browser category, click the option in the Mobile Devices section.

You can add managed code to your form solution so that a specific view is displayed depending on the environment in which the form is running. For example, your template may have a view that is to be displayed only when the form is accessed from a mobile Web browser. By adding the following code to the Loading event of your form solution, you can set the default view—in this case, a view named Mobile View—that is to be displayed when the form opens in a mobile environment.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
    if (Application.Environment.IsMobile)
    {
        e.SetDefaultView("Mobile View");
    }
}

A form template that is used in a mobile Web browser scenario must be admin-deployed, meaning it must be uploaded to InfoPath Forms Services and then activated to a site collection. Once deployed, users can access the form template on a mobile Web browser with the URL http://<server name>/_layouts/mobile/mobileFormServer.aspx?xsnlocation=/formservertemplates/<form name>.xsn.