Repeating Table with Dynamic Query (Revisited) - InfoPath Dev
in

InfoPath Dev

Repeating Table with Dynamic Query (Revisited)

Last post 01-23-2007 01:01 PM by Patrick Halstead. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-22-2007 03:06 PM

    Repeating Table with Dynamic Query (Revisited)

    Hello,

    Just checking to see if anyone has any new thoughts on this topic. Here's the situation...

    I have a repeating table of list boxes where the options in list box B are dependent on the selection from list box A. The cascade is achieved just fine using an OnAfterChange script that runs a custom query on a secondary data source...

    var query = "SELECT [Foo] FROM [Bar] WHERE [ItemA] = " + eventObj.Source.xml; 
    XDocument.DataAdapters['Bar'].Command = query;
    XDocument.DataAdapters['Bar'].Query();


    My only problem is that, when I have more than one row in my repeating table, ALL of the B list box options are cascaded based on the most-recently selected list box A option.

    Is there some way to "lock in" the options for all B list boxes, only allowing the options to change when the associated list box A is changed?

    BTW, I am working with a very large data source, so the "static data source" solution proposed in the referenced thread above will not work very well.

    Thanks!
  • 01-22-2007 03:13 PM In reply to

    Re: Repeating Table with Dynamic Query (Revisited)

    Hi Googo1p1ex and welcome to our forum!

    If the dropdowns are in a repeating section they will use the same data source. You could use a filter but that would require downloading everything on load. Another option is to use the taskpane and have the values copied over into the view.

    With the SQL query in code, you will have to have SQL Client Permissions which is not the default for .NET apps, so you may have to set to full trust or give them a CAS package to install. If deployment of CAS packages or full trust solutions is a concern for you (because 50+ people need to use it, for example), you should consider using a Web service. We have one that allows you to specify the query parameter:

    http://qdabra.com/free/QdabraDatabaseAccelerator_v2.0Beta_Developer.zip

    It'll also reduce your code and provides a boatload of other features.
    Let me know if you'd like me to walk you through config and integration.

    More later,
    Patrick Halstead
    Project Manager at Qdabra
  • 01-23-2007 11:34 AM In reply to

    Re: Repeating Table with Dynamic Query (Revisited)

    Hi Patrick, thanks for the quick reply and welcome!

    The Qdabra suite sounds pretty cool... currently I'm just playing with a basic prototype form using an Access DB on my local machine. Eventually though some version of the form will be used on my org's intranet, and being still kind of new to InfoPath (and MS dev in general) I'm sure I will have a lot of questions between now and then! :)

    Would the trust issues be any different if I used BuildSQLFromXMLNodes instead of putting the whole query in code?

    Thanks!
  • 01-23-2007 01:01 PM In reply to

    Re: Repeating Table with Dynamic Query (Revisited)

    I don't have the .NET permissions memorized, but I believe that any direct call to SQL from the client requires SQL Client Permissions which are not on by default for domain trust forms. My recommendation is just install the Web service trial and you can do this without writing any code. If you want to write code, try publishing the form to a website as domain trust and try opening it. If it works, you're golden!
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.