Adding Records Programmatically Before Submitting to Main SQL Data

G

Gcleaves

How can I add records ("Insert item") programmatically? I have a form
pointing to a SQL datasource and I need to add records when a user clicks a
button. The idea is the user click various buttons which programmatically
"Insert Items" into the dataFields. Then the user just clicks "submit" and
several rows should be added to the datasource.

I am able to modify the first record's data using Rules. But the problem is
that I just keep overwriting that first record everytime the user pushes the
button. Somehow I need to add a record first.

Thanks!
 
S

S.Y.M. Wong-A-Ton

If there is a repeating group under dataFields (which there probably is), you
can use appendChild() to programmatically add a group node (=record). Another
option would be to use XDocument.View.ExecuteAction with an insert action on
the group. Search this newsgroup on "appendChild" or "ExecuteAction"; there
are code samples available online.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top