Is there code for "New Record" Action ?

R

RonL

In infopath 2003, is there a code representation for the "New Record " Action
on a Control button ? I want to execute this action from code. Preferable
Javascript.
When executing this action from a button, it clears all fields and resets
the form. So after a Submit of the main database connection, any changes in
the form and resubmission results in a modification of the data instead of a
new addition.
I need to be able to reset the form without the user having to click the
"New record" button. (In my case, click it once and the fields (in a
repeating section) dissapear, click it again and they reapear, cleared)
 
C

Clay Fox

Typically I just clear the query fields and then put a bogus value in one,
like recordID 0 or something and requery the data connection.

This gives you a blank set of data fields.
 
R

RonL

That is exactly what I have done, but that still requires a click of the new
record button to restore the fields for input. as the query returns nothing,
it blanks the repeating section.
 
C

Clay Fox

On your submit button just add additonal actions which submit main, change
query fields as I described, requery main.
Then you have all of the data fields reset like new.

If you are trying to keep data as a template then you would need to copy the
data to a holding area and then back again.
 

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