Paul Galvin's (old) SharePoint space [SharePoint

Just another site

Solution: BDC Picker Shows Only One Column Of Results

In my on-going attempts at providing a more useful lookup column using BDC, I hit a wall with the BDC picker.  If you haven’t see it, the BDC picker is similar to a people picker except that it works with columns of type "business data".

You access the picker by clicking on the open book icon of a business data column as shown:

The above image shows a business data column called "Master Document Id".  That column is connected, via BDC, to a web service.  The web service returns two columns of information: Document ID and Title.  The business purpose here is to provide a "this document is based on" function.  Users select a "master" document and when they save, an event receiver copies meta data fields from the referenced master.

By default, the BDC picker looks like this when I search for a document whose ID = "38":

That’s helpful, but not good enough.  People don’t think in terms of IDs, they think in terms of titles and/or other meta data.  The picker allows you to search on other columns (e.g. Title) but won’t show the actual list of titles it found, just their DocId’s as shown here:

(The screen shot isn’t so great because I didn’t pick a search that returns any valid results, but you can see that if it had found some results, it would only have shown DocId’s, not titles).

I searched high and low for the answer to this and failed.  My colleague, the venerable Jonathan Bradshaw, had faced and solved this issue.  When I reached out to him for help, he pointed me in the right direction.

Configure the picker to show multiple columns via the "ShowInPicker" property in the ADF:

         <Property Name="ShowInPicker" Type="System.Boolean">true</Property>

In more detail:

  <!-- Title -->
  <TypeDescriptor TypeName="System.String" Name="Title" >
      <LocalizedDisplayName LCID="1033">Title</LocalizedDisplayName>
      <Property Name="DisplayByDefault" Type="System.Boolean">true</Property>
      <Property Name="ShowInPicker" Type="System.Boolean">true</Property>

Setting this property does introduce a minor problem.  As soon as you set it once, you need to set it for every column you want to show.  In my case, BDC picker showed DocId by default.  However, once I added "ShowInPicker" to Title, DocId no longer displayed.  I solved that by explicitly setting the ShowInPicker property for Doc ID.

Here is the result:

(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post.  In short, it’s a concatenated string that allows for a slightly better user experience).

Of course, having written this blog entry, I just did a search for "ShowInPicker" and found numerous hits, including this one:  It explains the meaning of that property along with some other good BDC stuff.


 Subscribe to my blog!

Technorati Tags:


4 responses to “Solution: BDC Picker Shows Only One Column Of Results

  1. Nick February 21, 2008 at 8:37 am

    Hi Paul,we\’ve got a screencast of how you can set this property with BDC Meta Man

  2. Paul February 21, 2008 at 8:43 am

    I found that once I searched for "showinpicker".
    I did all kinds of searching for a solution to this and couldn\’t find anything until Jonathan Bradshaw told me how he solved it.  Lots of hits on "ShowInPicker" but virtually nothing on "bdc data column shows only one column in web page dialog". 
    I didn\’t know what question to "ask" and so couldn\’t get a good answer.
    Everyone should certainly look at bdc meta man.  Hand crafting ADF files is not a good use of a human\’s time, that\’s for sure.

  3. juggler_101 July 28, 2008 at 11:23 am

    You\’ve covered most of the issues I\’ve come across over the last month, it\’s great to see them in one place. My question is how you are searching by more than one column in the picker. I haven\’t had any luck getting the BDC to search by more than one column. I\’ve created multiple filters and that gives me a second option in the dropdown but i haven\’t been able to actually get it to work with the query. And direction would be great.

  4. Jean-Marie January 9, 2009 at 7:50 am

    Damn… This Article saved me a lot of time and my live :-))Great Post and your Blog added to my favorites. By the way, I found the article by googling "bdc could not find fields to insert all the identifier values" *lol* ;-)Regards, Jm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: