Ok - this is the basic path users take. Please forgive me if I cover any unnecessary ground or miss anything.
At the first screen, they choose the hardware that they want from a data connection which is entered into a repeating list with an identifier called HID - it has various other fields that are mostly pulled from the data connection.
In the second screen the user does the same but for a software list with SID
In the third screen, they can add users from a data connection to a user database. Again, it is repeating with a unique identifier UNetID.
When they come to the order screen, there is a script that I want to run that automatically populates the first Order group (assuming it has not been previously populated) with the ID numbers from each of these previous fields.
The reason I have a repeating Order group is because on occasion people will put in multiple orders in a single form (i.e. everyone wants this hardware but only 3 people want the software on top so the software and those people are bunged in a seperate order at the bottom).
The problem I am having is when we come to the Order page.
<my:Order return="false">
<my:HWID />
<my:SWID />
<my:UID />
<my:Info />
<-- I think it's trying to insert <my:UID /> here
</my:Order>
The system is happy to copy across one user, one software item and one hardware item, but as soon as I try to add another of any of them (they are repeating elements - info is not) it throws the error described above.
I am wondering if the Order is empty, should I delete it and start from scratch with nothing then add Order back in to the parent element my:myFields. This is pretty much the only thing I can think of that I haven't tried but I'd be grateful for any other suggestions in the mean time.
For anyone else looking at this, I have tried XDocument.View.ExecuteAction("xCollection::insert", "UID_4") and get an "unspecified error" but I know the group is named properly. For some reason it just doesn't want to add a node!