Controls without Datasources - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Controls without Datasources

Last post 07-30-2010 01:33 AM by greenawayr. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-28-2010 07:14 AM

    Controls without Datasources

    Thanks for reading my post.

    I've created a form that uses a Webservice as it's main datasource.

    The webservice is connected to a SQL database that contains various tables, each of which represents a different part of the form.

    There is a client table and the form has the "Client" section that relates to it.

     I then have a range of financial products (6) each with their own table, with the idea being that they are represented as Optional Sections on the form, and if the client is buying "Financial Product 1" then "Financial Product 1" Optional section is selected and the relevant details about the product are filled in then returned to the Submit webservice.

    The problem I've hit upon is that when dragging the "Financial Product 1" Datasources onto the design view of the form I can only use them within a section or Repeating Section. This is fine as there may be more than 1 "Financial Product 1" sold to a customer at a time, however I am unable to enclose this section within an Optional Section to stop it being visible and active, until the user selects it.

    It seems I either need to add a datasource to the SQL Database that is then submitted to the Dataset for the webservice to pick up as a "Group", or I need to add a Secondary Datasource with some sort of Group that I can add these optional sections to.

    I have only designed forms using a blank template before, so I could just add any old controls and they'd appear on the Main Datasource, however this obviously works a little differently so would appreciate some help explaining how to create this datasource for an Optional Section, what sort of Datasource it has to be and how to make an Optional Section available to use.

     Thanks 

  • 07-28-2010 07:27 PM In reply to

    Re: Controls without Datasources

    Hi -- I know with forms that use a database as their main data source, you can add additional fields to the data source -- but only to the root node. Perhaps this is also true of forms with a Web Service as a main data source? If not, you could create an XML file and add that as a secondary data source, bind your optional sections to a group in that....

    Hilary Stoupa

  • 07-29-2010 06:35 AM In reply to

    Re: Controls without Datasources

    Thanks, my thoughts were that it would have to be through a secondary datasource.

    Any idea what the xml file would look like for an Optional Section?

     

    THanks

  • 07-29-2010 09:39 AM In reply to

    Re: Controls without Datasources

    Did you try right clicking the root node in your Main Data Source and seeing if you could add a group there?

    Because it doesn't look like a straight XML connection will work-- just like with your Web Service, you can't make a section optional from a secondary data source.... It may be possible if you modify the InfoPath generated schema for the data connection after you add the secondary data source, but you'd need to save your form as source files and investigate that.

    Would hiding the section and then giving the user a control that displays the section take care of this requirement for you? Because you could, instead of using optional sections, use a standard section with conditional fomatting.

    Hilary Stoupa

  • 07-30-2010 01:33 AM In reply to

    Re: Controls without Datasources

    I was able to right click on the right node and add a group, from which I was able to create an optional section. Not sure whether this will present any further problems when it comes to submit/receive but will be back again if it does.

    I have to have them in Optional sections, as there is validation required on the fields and as such, if the fields are hidden but still present on the form then they would require filling in and as up to 5 of these optional sections may not get filled in at a time, I don't think that's feasible, unless there is some way of negating the validation of a required field if it's not visible. Is that possible?

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.