Consuming External Content Types(BCS) in InfoPath Forms
February 16, 2010 6 Comments
Business Connectivity Services(BCS) is one of the coolest features in SharePoint 2010. BCS helps us connect to Line of Business applications without writing a single line of code.
In this article, we will explore the process to connect to BCS and use the information within an InfoPath form. A business scenario would go something like this
“You need to create a Expense Report form. Users entering expenses will need to pick a valid project from your Line of Business system within the InfoPath form”
Check out these articles on how to create the BCS model and connect to your Line of Business system
Now that you have a BCS system, lets display those fields within an InfoPath form
In my example, I have a simple SQL Table with a list of projects as shown below
We need to build an InfoPath form where users can pick one of the projects from this list.
My external content type in SharePoint Designer looks like this below
Notice the following properties ‘coz you will need them when you build your form in InfoPath
Name, Namespace, External System
Open up InfoPath 2010 and design a blank form
In the Home Tab, Under the Controls section choose the External Item Picker option under the input sub section and add it to the form
InfoPath will add a new group to the data fields with some properties.
Add the Field to the InfoPath form, right click and pull up the Properties for the external Item Picker
Enter the Namespace of your ECT , Name of the ECT and the System Instance Name(in our case it is CRM) into the required fields. <edit>Enter the Display Name of your field, otherwise you would only the see the identifier when you preview the form..</edit>
Note: After two hours of frustration, I found this to help finding information about the system instance name. There is no help for the required fields and at first I couldnt figure out what the “System Instance Name” was. Is it the name of the Finder ? Is it the name of the Entity? . A search on MSDN retrieved the following article
The System Instance name is a property of the SPBusinessDataField. So to find out the property, I added the same field to a custom list and wrote some code as follows to retrieve the System Instance Name
The system Instance name was the same name as the external system property in SharePoint Designer.
Click the Other Settings tab in Infopath and set the following properties. Check the “Refresh on Open” option and select the dropdown for the picker mode to “Connect to external data through SharePoint”
Click Ok and Hit Form Preview. Now you can search for content in your LOB and surface them through InfoPath. We will discuss saving this data to SharePoint in another post.
Pingback: SharePoint 2010: Recopilatorio de enlaces interesantes (V)! « Pasión por la tecnología…
Pingback: Infopath external content type field @ The Buzz Blog
Hi,
how can I use this if I have a regular Sharepoint list, where I have a column with External Data, and want to use InfoPath forms for this list?
audunms: Did you figure out how to use this in a regular SharePoint list? I have the same challenge.
I found no solution ufortunetaly, so we made a web service and consumed this in the Infopath form in stead.
Yes you can use the External Content type list and use it as if it was a native SharePoint List and use it in your infopath form. One caveat is that if the database is over 1000rows that you are retrieving the External List will fail. This is caused because of throttling restrictions. Simply up the limit via powershell or add filters to the external content type to limit the rows returned.