Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2004

Tip: Looking for answers? Try searching our database.

Pass parameter to InfoPath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vb6dev2003 - 01 Sep 2004 21:42 GMT
Hi,

I have a small VB program with a list of employees.  When I click on one
employee, I would like the employee ID to be passed to InfoPath (which I
call during the click) in order to feed the ID as a parameter to a Web
Service (second data source in my IP form).  At this point, I have no XML
file yet.  I just want to pre-populate a few fields (name, age, etc.) based
on the ID.
What's the best way to do this?  Looks like it should be simple..but can't
figure it out.

Thanks

vbdev
Alexander Prozor - 02 Sep 2004 09:21 GMT
you can get DOM of XDocument ( after registering of solution ).
find elements ( fields ) that you willing to fill and set its values.
sorry, I can't give you a VB example.
you can get the main idea from this c# code:

                    infoPathApp.RegisterSolution(fileName, "overwrite");
                    infoPathApp.XDocuments.NewFromSolution(fileName);
                   
XDocument document = infoPathApp.XDocuments[infoPathApp.XDocuments.Count
-1];

foreach(System.Data.DataColumn column in _ProcessContext.Tables[0].Columns)
{
string fieldName = column.Caption;
node = infopathDOMDocument.selectSingleNode ("//my:"+fieldName);
if(node != null)
{
    string fieldValue =
_ProcessContext.Tables[0].Rows[0][fieldName].ToString();
node.text = fieldValue;
}
}

> Hi,
>
[quoted text clipped - 10 lines]
>
> vbdev
vb6dev2003 - 02 Sep 2004 19:22 GMT
Thanks
vbdev

> you can get DOM of XDocument ( after registering of solution ).
> find elements ( fields ) that you willing to fill and set its values.
[quoted text clipped - 33 lines]
> >
> > vbdev
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.