Trying to stuff a SQL-submit repeating table into a repeating section...is one-to-many better? - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Trying to stuff a SQL-submit repeating table into a repeating section...is one-to-many better?

Last post 09-08-2011 10:37 AM by Rae. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-07-2011 06:58 AM

    • Rae
    • Not Ranked
      Female
    • Joined on 08-31-2011
    • Posts 20

    Trying to stuff a SQL-submit repeating table into a repeating section...is one-to-many better?

    Yesterday I asked a question about a SQL-receive repeating table in a repeating section, and I got an answer that probably would have been perfectly fine if the project spec didn't suddenly expand.

    Now, I need to put a SQL-submit repeating table in a repeating section.

    I created a form from a data connection, made the repeating table, and with some creative (and probably not best practice) rearranging ended up with a form that has a repeating table with some of the fields and a few separate text fields that have the rest of the fields. I've got everything stored in one big table in the DB, even though the separate fields should be the same value for every row of the table in a particular instance of a repeating section. If this is confusing...well, just imagine how I feel.

    When I try to create a repeating section to stick all of this in, it requires that I bind it to something in the data source, even though I don't want to. When I just attach it to the data fields from the DB like in the repeating table, and then put the table in the section, InfoPath says the data won't store correctly. When I try to preview it, I can insert new items in the repeating section, but not the repeating table - even though there is still an "insert item" button.

    Is this sort of thing not allowed? Would I be better off trying to use a one-to-many relationship in the DB and arranging the form that way? If so, how do I do that? Everything I've found while trying to Google it has been related to Access databases, (like this otherwise useful-looking how-to guide), which is a bit of a concern. Would a one-to-many relationship work here? Or do I need to do something else entirely?

    P.S. I'm using InfoPath 2003, and Microsoft SQL Server 2005

    Edit:
    I've found that I can add a new group that's apparently unattached to the DB, and attach the repeating section to it, and it *almost* works (if I use current() I may be able to force it to work...right now everything in one instance of the repeating section gets copied immediately into all the others), but my main question still stands - should I be using a one-to-many relationship, and if so, how do I do that? Thanks.

  • 09-08-2011 10:37 AM In reply to

    • Rae
    • Not Ranked
      Female
    • Joined on 08-31-2011
    • Posts 20

    Re: Trying to stuff a SQL-submit repeating table into a repeating section...is one-to-many better?

    It looks like a one-to-many relationship is perfectly fine, so far, and remarkably easy. Just set up the tables in SQL, base a form off the data connection, and go. All other troubles are automagically gone. I just dragged my top repeating folder into the place that says "drag data fields here," chose Repeating Table with Controls, and ended up with basically what I got in my other version of the form, except that everything works now.

    So basically, all the things that I was asking for in this thread, as well as my issues with putting a repeating table in a repeating section and getting the right data back into that repeating section, were fixed by choosing a one-to-many relationship and using two tables in the database instead of a (very convoluted) singular table.

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