Populating a combo box in Infopath from a webservice
Aim: to create an Infopath form that displays a list of companies in a combo box and displays additional information when a company is selected.
The data will be served by a WCF webservice talking to a SQL Server backend. In theory I should be able to use a stored procedure (and associated meth开发者_开发百科ods in the webservice) to get a list of all the companies and their associated ids, populate the combo box in Infopath, then link the selection of the company name to its id and then pass that id on to another stored procedure to return the additional information.
However, when I try to wire up my webservice method to return all companies, I can't plug the company name field into a single combo box as the data returned is repeating.
Am I doing this wrong? Should I just use a single method that returns all company information (there's about 700 or so) and then create a filter on the company name field instead?
the combobox returns one single company id. This id can be used to search the company name in the company list returned by the webservice.
Can do without coding:
Create a rule 'CompanyIDChanged' on the combobox. Then create an action 'Set a fields value' for this rule. Set the form field 'CompanyName' to the value 'CompanyName' of the webservice. Use a filter on the value to set CompanyName for the correct CompanyID. The filter should be 'CompanyID' in the combobox = 'CompanyID' in the webservice.
Regards Jack Graus
精彩评论