Can I pass parameters to the InfoPath form when using this scenario?

G

G. Tarazi

I had a look at this article

http://msdn.microsoft.com/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09..asp?frame=true



It's about the 2 way communication between the InfoPath form and a web service, the idea looks nice, currently I am using an InfoPath form with a web service in a little bit different way (because of the parameter thing) and I would like to change my code to the one in the article (if I can solve that problem).



Ok, I have a web site that has a list of links, the links are similar to the following:

http://test.test.test/myproject/generate.aspx?FormKey1=4&FormKey2=5



When I click the link, this aspx page will receive the keys, will call the internal application modules, will generate the xml file, will put the processing instructions in the file, and finally will execute the XML on the client computer so InfoPath will open automatically.



The only problem here is the amount of code that we are running in the background, and the debugging of the form against the web service/aspx page.



My question is, can an InfoPath form receives a parameter using a link, something like the following:



http://test.test.test/myproject/myform.xsn?FormKey1=4&FormKey2=5



Of course that code does not work, but is there any other possible scenario close to that one?



Thank you
 
G

G. Tarazi

I was planning to do that at the beginning, but the idea is that InfoPath
must store the data into a database, and at the same time have a copy of the
data disconnected from the database in the InfoPath form, and each time the
end user presses the submit button the xml is sent to another web service
and saved in 70+ tables (depends on the InfoPath form, there are more than
one)



Part of the data of the form must also appear in a custom lists in
SharePoint "another requirement, for the internal portal" :)



And the Xml must not be stored as is "that was a major requirement of the
client".



So we end up generating the XML on the fly per user request, and 2 or more
forms can share part of the Xml in some sections.



I have an idea, I don't know if it will work, it's to pass an Xml as a
parameter (I believe InfoPath SP1 will accept that) that matches the request
query schema (I don't know if it will accept that), and then using an event
handler inside to trigger the query, I don't know if that will work, but I
will try anyway.



Thank you for the response.



George

http://LiveTechnologies.ca





InfoPath, currently, does not allow you to directly pass parameters in. This
would be a great feature for the next version, and I know Microsoft has
heard many of us request this feature. But we'll have to wait and see.

As for alternatives, it sounds like you are already doing the one thing that
may be your best choice. That doesn't mean that there's not a better choice
somewhere which still needs to be discovered.

The one question I have for what you are doing is this: Why are you
"generating" the XML file each time? Why not have an XML file stored and
ready to go, then just load it, set the few values you need to, and then
pass it along. Seems like this should be a lot faster and require less
debugging.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message
I had a look at this article

http://msdn.microsoft.com/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp?frame=true



It's about the 2 way communication between the InfoPath form and a web
service, the idea looks nice, currently I am using an InfoPath form with a
web service in a little bit different way (because of the parameter thing)
and I would like to change my code to the one in the article (if I can solve
that problem).



Ok, I have a web site that has a list of links, the links are similar to the
following:

http://test.test.test/myproject/generate.aspx?FormKey1=4&FormKey2=5



When I click the link, this aspx page will receive the keys, will call the
internal application modules, will generate the xml file, will put the
processing instructions in the file, and finally will execute the XML on the
client computer so InfoPath will open automatically.



The only problem here is the amount of code that we are running in the
background, and the debugging of the form against the web service/aspx page.



My question is, can an InfoPath form receives a parameter using a link,
something like the following:



http://test.test.test/myproject/myform.xsn?FormKey1=4&FormKey2=5



Of course that code does not work, but is there any other possible scenario
close to that one?



Thank you
 
G

G. Tarazi

I just realized that I will run to more problems, I am sating with the aspx
page for now :)



Thank you



G. Tarazi said:
I was planning to do that at the beginning, but the idea is that InfoPath
must store the data into a database, and at the same time have a copy of the
data disconnected from the database in the InfoPath form, and each time the
end user presses the submit button the xml is sent to another web service
and saved in 70+ tables (depends on the InfoPath form, there are more than
one)



Part of the data of the form must also appear in a custom lists in
SharePoint "another requirement, for the internal portal" :)



And the Xml must not be stored as is "that was a major requirement of the
client".



So we end up generating the XML on the fly per user request, and 2 or more
forms can share part of the Xml in some sections.



I have an idea, I don't know if it will work, it's to pass an Xml as a
parameter (I believe InfoPath SP1 will accept that) that matches the request
query schema (I don't know if it will accept that), and then using an event
handler inside to trigger the query, I don't know if that will work, but I
will try anyway.



Thank you for the response.



George

http://LiveTechnologies.ca





InfoPath, currently, does not allow you to directly pass parameters in. This
would be a great feature for the next version, and I know Microsoft has
heard many of us request this feature. But we'll have to wait and see.

As for alternatives, it sounds like you are already doing the one thing that
may be your best choice. That doesn't mean that there's not a better choice
somewhere which still needs to be discovered.

The one question I have for what you are doing is this: Why are you
"generating" the XML file each time? Why not have an XML file stored and
ready to go, then just load it, set the few values you need to, and then
pass it along. Seems like this should be a lot faster and require less
debugging.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message
I had a look at this article

http://msdn.microsoft.com/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp?frame=true



It's about the 2 way communication between the InfoPath form and a web
service, the idea looks nice, currently I am using an InfoPath form with a
web service in a little bit different way (because of the parameter thing)
and I would like to change my code to the one in the article (if I can solve
that problem).



Ok, I have a web site that has a list of links, the links are similar to the
following:

http://test.test.test/myproject/generate.aspx?FormKey1=4&FormKey2=5



When I click the link, this aspx page will receive the keys, will call the
internal application modules, will generate the xml file, will put the
processing instructions in the file, and finally will execute the XML on the
client computer so InfoPath will open automatically.



The only problem here is the amount of code that we are running in the
background, and the debugging of the form against the web service/aspx page.



My question is, can an InfoPath form receives a parameter using a link,
something like the following:



http://test.test.test/myproject/myform.xsn?FormKey1=4&FormKey2=5



Of course that code does not work, but is there any other possible scenario
close to that one?



Thank you
 

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