James,
It sounds like an interesting project.
I would suggest starting with creating the form as the user would use it to enter the initial data.
Second, define a data connection to insert data into a particular database and add a button to the form which, when clicked, will execute the data connection and insert a new record into the database using the data supplied by the user. To make this even better, I would make the button initially invisible and would use a hidden text field to trigger its appearance: In the text field's "Form:Ready" event, if its value is not empty, set the button's presence to be visible. This way, when the user fills-in the form and submits it, they don't see the button but once the data is imported into the form by the Corp Rep, the button appears so that they can save the data to the database. To create the button's script, you'll need to read the article I just posted to my blog which demonstrates
how to insert, update and delete records in a database. You'll also need to generate the "INSERT" SQL statement pulling-in the necessary values from the correct fields on the form.
Third, to ensure that the hidden text field's value is set prior to the user submitting the form's data in the first step, you should use what I call the
two button submit technique. When the user clicks the visible (regular) button, the Click event sets the value of the hidden text field to some value of your choice and then executes the invisible submit button's Click event, causing the form's data to be submitted with the user's supplied values and a value specified for the hidden text field.
Fourth, when the Corp Rep receives the form's data in XML format via email, they would open the form and import the data into it. Since the hidden text field's "Form:Ready" event will be fired after data is imported, the "insert into database" button will appear (since the text field's value will be set to something other than empty from the imported data).
Finally, the Corp Rep can make any necessary adjustments when then click the "insert" or "save to database" button to create the new record in the database.
Stefan
Adobe Systems
More answers on
FormBuilder.