How To Submit and Refresh the Active Form Window Programmatically?

B

Barry Prentiss

Hi,
I am creating a new form from a template in InfoPath/Sharepoint '03 and
VBScript using NewFromSolution().
I am then filling in fields and submitting the form programmatically.
I am stuck trying to refresh the active form in order to display the form
name (which is created on submit) in the browser window, and the newly
submitted data (which has conditional effects on the form itself).
I cannot use XDocument.Save() because this is not a Fully Trusted form.
I can reopen the form by it's new name, but then have to close the old form
window.
Can I reset the current window to display the newly submitted form?
If so, how do I get the window reference to call the open?
Thx,
Barry
 
S

Shiva (GGK Tech)

Hello,

We can see the submitted data in existing from without closing the form
right? How do you want to refresh the existing data?
After once submitted data you want to modify it and it will override the
existing data? If you want we can submit the data using SharePoint connection.
 
B

Barry Prentiss

Thx Shiva,
A great article from Hillary Stoupa on creating and appending new records
into an xml document.
I can use this to resolve some of my other InfoPath issues...
Barry
 
B

Barry Prentiss

Thx Shiva,
I guess I'm not describing my problem properly...

I am opening an InfoPath '03 form from a Sharepoint '03 form library.
I am selecting a button in this (parent) form to create another (child)
form using .NewFromSolution(.../template.xsn)
This opens a new form window, usually called 'Form 3' or something similar.
In the Onclick event code (in VBScript), I am populating some of the fields
in the child form with data from the parent form.
I then call Xdoc.submit() to submit the child form to the form library.
The submit rules and datasources create a sequential name for the child
form based on the parent form name and existing childforms, then submit it
to the library.
The child form updates properly with the newly assigned name displayed in a
field of the form, but the window name remains 'Form 3'.

I have (at least) two problems:

1. When I close the original child form window, I am prompted to save the
child form (even though it has already been submitted to the library).
a. I can't call xdoc.save() because this is not a Fully Trusted form.
b. I don't want the user to save the form locally using some random form
name.
c. I can re-open the child form from the form library, but then have to
close the original child form window (which prompts for a save).
d. I'd prefer to 'refresh' the child form window to display the child
form with the newly submitted name instead of 'Form 3'.

2. The parent form needs to be refreshed to apply the new child form info
a. a Child Forms popdown field needs to include the new child form.
b. Certain sections are displayed conditionally based on child form
presence
c. I've tried View.ForceUpdate() but this doesn't re-call the
datasource.
d. Perhaps a .Query() will do this?

Any suggestions?
Thx,
Barry
 

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