Submitting more than the main data source

J

Jack

I have a document that I've created with a main datasource for most of the
fields. However, there are a number of fields that get prefilled when the
document is created based on the input parameters. To do this I created
another data source, and bound those prefilled fields to it. Now I have a
main datasource and a secondary one. In my Main submit datasource which
submits the form to a web service, one of the parameters of the webservice
is the XML of the entire form. If I just set the parameter to the Entire
Form option in the data connection wizard, only the main datasource gets
submitted. I want the values of my prefilled fields to be submitted as well.
How can I do this? I need the XML to contain everything, so when my
application retrieves that XML later it can open up the infopath document
and have the same initial information in the prefilled fields.

Another example of this would be if I had a third data source that was used
to retrieve values for a dropdown list. I'd like the entire list of values
to be submitted along with the Main data source, so that the next time the
document is loaded, the same list comes up.

Thanks...
 
F

Franck Dauché

Hi Jack,

Secondary datasources are typically used to store drop-down boxes choices,
configuration data, etc.
Any field that needs to be submitted should be in your main DOM. If you
need to "pre-populate" fields, you can do it from the OnLoad event of your
form or you can set Default Values in your controls linked to your DOM.
If you need to use a secondary DOM for these initial data, you could also
read that secondary DOM and pass the values that you are interested in to
your main DOM.

Hope that it helps.

Regards,

Franck Dauché
 
J

Jack

Thanks Franck. That makes sense for pre-filled values, but how can I
address my other example in the initial post?

"Another example of this would be if I had a third data source that was used
to retrieve values for a dropdown list. I'd like the entire list of values
to be submitted along with the Main data source, so that the next time the
document is loaded, the same list comes up."
 
F

Franck Dauché

Well, this is the job of the secondary data source. You don't need to submit
it back. The drop-down choices should be linked to your data source, which
is then part of your xsn file.
Next time you open the form, the drop-down list will still be available to
users. You can have as many secondary DOM as you have drop-downs if you want
to...
The job of the primary DOM is just to store the "final" choice of the user.

Does it make sense?

Regards,

Franck Dauché
 
J

Jack

Yes, that makes sense. But what about when they go offline? If all the
options from the dropdown list are stored in the submitted xml, they
wouldn't have to be connected to the datasource to see the options when they
open the document offline.
 
G

Greg S

Jack,

I'm doing something very similar. I have a number of 2ndary datasources,
some are pure lookups and other are effectively join tables. For offline
work I have to copy/clone all the 2ndary sources into the main DOM. Any
updates to these nodes can be uploaded to the database when the user is on
line -- but it all happens through code-behind and calling SQL stored procs
directly. Its some work, but doable.
 
F

Franck Dauché

Yep, and you can get the best of both world:
On load, check if you have connectivity. If not, get values from secondary
data sources from XML. If yes, get data from the DB...etc.
But, coding can get heavy.

Franck
 
J

Jack

Thanks for your help guys!

Franck Dauché said:
Yep, and you can get the best of both world:
On load, check if you have connectivity. If not, get values from
secondary
data sources from XML. If yes, get data from the DB...etc.
But, coding can get heavy.

Franck
 

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