Preview vs Browser discrepancies - InfoPath Dev
in

InfoPath Dev

Preview vs Browser discrepancies

Last post 02-05-2013 02:06 AM by stukkend. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-04-2013 07:03 AM

    • stukkend
    • Not Ranked
    • Joined on 01-13-2010
    • South Africa
    • Posts 7

    Preview vs Browser discrepancies

    I have an Administrator (full-trust) IP2010 web form. I wrote some code that runs in OnLoad event. The code basically applies a filter to a Secondary Datasource, which is a SharePoint list. The filter basically trims down the list to only items where a specific column contains the current user's username. I have a repeating table that shows the data in the secondary list. When I run the form (and code) in preview mode, everything works well. I then publish the form to SharePoint, but the data is not filtered. It's as if the code in the OnLoad event is not being called at all. I have also tried to filter the repeating table by applying a rule that states : hide the control (table) if DisplayName in the repeating table row is not the same as the DisplayName in a field that I set using the GetUserProfileByName web method. Again, in the preview this works well, but in the browser, all rows are returned, but here's the weird thing; when I hover over the repeating table, the rows that I do not want then disappears. This is very quirky and not a suitable solution. Has anyone ever experienced this type of behavior? Could it be that I am using the OnLoad event incorrectly? Is there any other way I can pre-filter a secondary datasource that reads a SharePoint list?
    life happens...
  • 02-04-2013 09:12 AM In reply to

    Re: Preview vs Browser discrepancies

    stukkend:
    Is there any other way I can pre-filter a secondary datasource that reads a SharePoint list?

    If you're using InfoPath 2010 and SharePoint 2010, then you can indeed filter. This feature is available out of the box and you don't need any code.

    When you create the data connection, you'll see you have queryfields and datafields.

    Set the filter value in the queryfields, then execute the data connection, and you'll get the filtered results back in the data fields.

    So it seems to me like there's an option simpler than using code, and perhaps the solution is to investigate and pursue this easier alternative.

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 02-05-2013 02:06 AM In reply to

    • stukkend
    • Not Ranked
    • Joined on 01-13-2010
    • South Africa
    • Posts 7

    Re: Preview vs Browser discrepancies

    Ernesto, you have opened my eyes! Thank you! This works great. I remember doing this a few years ago, but just forgot how I did it. Haven't done IP development in a long time. I will add this to my bag of knowledge. Keep on rocking dude!
    life happens...
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.