Hey guys,
I've got a major problem figuring out how I'm going to accomplish a certain task on my form. I have a repeating section, and within the repeating section is a field called delegateToEmail, as well as a button. Now, I have a dataconnection which emails the address in delegateToEmail. However, it ALWAYS uses the delegateToEmail that's in the first repeating section, which as can be imagined, is a pretty major problem. Is there any way to reference the number of repeating spawns.
Does anyone have any ideas as to how I can fix this? Really in a jam here...
Thanks,
Repole
EDIT: THE ABOVE HAS BEEN SOLVED, thank you very much to the contributers. I have two more questions now.
Problem 1: I know it's something that's already been answered here numerous times, however whenever I go through those threads I still end up lost: autonumbering.
My form has a field referenceID. What I need is to query my database and return the largest reference ID. Now, when I run XDocument.QueryAdapter.Command = "SELECT referenceID FROM Requests ORDER BY referenceID DESC";
XDocument.Query();
The largest reference ID in the database is returned, which is great. However, running a query locks up the rest of the fields.
http://www.infopathdev.com/forums/p/4467/16871.aspx#16871
In that thread there's a solution posted, however while this does create unique indexes in the database, the user doesn't see the referenceID. I need the referenceID to be on the form and the user to know the referenceID of the form they're submitting.
http://www.infopathdev.com/forums/t/4367.aspx?PageIndex=2
In that thread, while there are some ideas that i've played around with, none seem to solve the problem fully.
Problem Two: Inserting a repeating section programatically. Again, this has been discussed quite a bit, but I'm still failing to understand a lot of what I've seen. Basically what I want is a button that acts just like the "insert repeating section below." The reason I'm setting things up like this is because the repeating section is initially hidden, and for some reason that text doesn't get hidden in the process. I saw an ExecuteAction and ::Insert thing going on through some googling, however, still a bit lost. Am I on the right track with that?
Problem #1 is the big priority here, the autonumbering is an absolute must. I'd love to solve problem #2, but it's not essential. I'm leaving my job Friday, and I really need to get this finished. I appreciate all the help I've been given so far.
Thanks