Code in browser-enabled forms - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Code in browser-enabled forms

Last post 08-01-2011 11:56 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-27-2011 12:16 PM

    Code in browser-enabled forms


    I have an interesting problem. A have a browser-enabled form with code but it doesn't seem to work as it should. The code runs correctly in the client, but in the browser, it doesn't work.

    The purpose of the form is to allow users the ability to update information based on their sales region. The form references two SharePoint lists in the form of XML files.

    The first SP list matches a user with their respective sales regions. Thus, a user should only have access to their sales regions. The second SP list associates the sales items to the region.

    Basically, the user should be able to do the following:

    1. Select their region from a dropdown list
    2. Select the sales product from another dropdown list (this list is filtered based on the selection from the first list)

    Ideally, the form performs the following functions:

    1. Captures the user ID (via a rule). The user ID is used to filter the first SP list.
    2. Filters a dropdown menu for the sales regions associated to the user ID (loading event code)
    3. User selects their region from the dropdown list
    4. The second SP list is filtered based on the user's selection (code)
    5. The user selects the sales product from the second dropdown

    I'm using the form's loading event to capture the user's ID and then filtering the first SP list. Again, for some reason this only works in the client and not in the browser enabled form. Any help would be much appreciated.



    Filed under: ,
  • 08-01-2011 11:56 PM In reply to

    Re: Code in browser-enabled forms

    Hi David,

    Filtering isn't supported in InfoPath Form Services under MOSS 2007. It seems to work more in SharePoint 2010 but it's not a slam dunk. Several people have blogged on this site how to do filtering in browser based forms. Setting a value or querying a data connection will work just fine in the browser. It's just that dropdown filtering won't. So, the key is to change the business logic to "push" the value as opposed to filter based on a pull. Let me know if you don't find the blogs or other posts. Search the site for filtering browser or look for David Airapetyan's blog. qRules will enable parameterized list querying via filterowssvr or you can google around for other approaches that use filterowssvr to filter dropdowns. In SharePoint 2010 you can use OData and it's super easy to query lists with parameters to get a subset that you display in your second dropdown.

    Hope this helps,

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.