GUID's and repeating sections - InfoPath Dev
in

InfoPath Dev

GUID's and repeating sections

Last post 08-17-2010 08:04 AM by greenawayr. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-01-2010 07:14 AM

    GUID's and repeating sections

    Hi,

    I've created a form with a couple of repeating sections in it. I wanted to include a hidden text field that could contain a GUID generated from an SQL database that would be different for each repeating section and it's multiples.

    The text field connects to a data connection which contains a sql statement "select newid() as GUID" and inserts the GUID into the text field. The problem I have is that when I click "Insert Item" on the repeating section, to bring up a new section, the GUID contained in the textbox is the same as the GUID in the first entry of the repeating section.

    Any idea how to get this to refresh when the nex text box is generated in the repeating section? Or will it always use the same GUID because it is referencing the same data source?

    Any help is gladly accepted.

    Thanks in advance.

  • 03-01-2010 07:25 AM In reply to

    Re: GUID's and repeating sections

    Set the default value of your repeating field to be a formula pointing to the GUID field in your secondary data source, and uncheck "Update this field when the value of this formula changes."

    Then add a rule to the GUID field in your repeating section to re-query your SQL connection, so that a new GUID is ready and waiting for the next row you add.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-01-2010 08:16 AM In reply to

    Re: GUID's and repeating sections

    Excellent, thank you very much. I'm also struggling setting a rule so that this GUID field is empty unless a check box is set to true to indicate that this section is "active". I think I need to set the rule on the Check Box, but I'm not quite sure how to construct this.

     

    Can you help with this please?

  • 03-01-2010 08:38 AM In reply to

    Re: GUID's and repeating sections

    This would be considerably trickier.  Setting the value of a field in a specific row of a repeating section is inherently difficult.  Is it critical that the inactive rows not have GUIDs?  I'm not sure what your scenario is, but might this cause the issue of a row getting an entirely new GUID if it were made inactive and then active again (though perhaps this is the behavior you're going for)?  One simple alternative could be to use conditional formatting to hide the GUID field on inactive rows.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-01-2010 08:48 AM In reply to

    Re: GUID's and repeating sections

    Each section is a different type of financial product, we have 6 different sections, all of which are hidden from the user, till they select the product they need to fill in, at which point when the relevant check box is set to true, the field appears. We would like all the fields to be empty (or even classed as inactive if this is possible) so that this section is ignored unless it's check box is set to true. My worry being that we'll have 6 GUID's on the result of a form, with no information to tie with them. Whether this will have an impact at a later stage I'm not sure. At the same time, I need to set up rules so that any compulsory fields in sections where the check box is set to false, are not actually compulsory.

    Effectively I need to be able to turn a section on or off with a check box, the more I think about this, the more complicated it seems to be getting.

    Thanks

  • 03-01-2010 08:52 AM In reply to

    Re: GUID's and repeating sections

    I have happened upon a property in the "section properties" that looks like it might help. "Do not include this section in the form by default" would presumably forget the section exists until the user does something, such as checking the relevant check box.

    I now see that this allows you to turn the section into an optional section, so I could do away with the check boxes altogether and use the Optional section links provided to allow people to add the section. Therefore, any section that isn't added is therefore ignored with regards to validation etc.

  • 08-17-2010 08:04 AM In reply to

    Re: GUID's and repeating sections

    Sorry to bring up my old thread, but I've run into a new problem along the same lines.

    I have a form that has a webservice as it's main datasource.

    There are several tables on a database that have been made into a dataset for the webservice to read and populate into the forms datasource.

    Each table represents a section of the form that I want to use as a repeating section, so that more than one record can be entered into any of the tables with one form. However, not all the sections will require filling in, as such the validation required in these sections needs to be ignored so I have placed each of the repeating sections inside an Optional section.

    My problem is that when the Optional Section "Insert" link is clicked and the section appears/expands, the repeating section is there but "minimized" so the user then has to click the "Insert" link for the repeatig section as well which doesn't look good at all. When I was using a blank datasource I was able to edit the properties of the repeating section and "Show" the repeating section, however I can't seem to find that option now, and most of the options in the repeating sections properties are greyed out.

    This is presumably an effect of having an external (webservice) as the main datasource. Any ideas why and how to overcome this?

    Thanks

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