Matching a business entity without using the address book

In MOSS 2007 you can use Business Data Catalogs (BDCs) to expose business entities. For example, you can add a column type that lets you choose one of your company’s products.

I had a BDC file that *almost* worked. It let you choose a product using the address book, but would not match the product when it was entered in the text area. In turns out you need to specify that the FilterDescriptor on your finder method is UsedForDisambigution. Clear as mud right? An extract from the BDC XML is shown below:

<Method Name="GetTradeProducts">
    <FilterDescriptor Type="Wildcard" Name="TradeName">
        <Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
    <Parameter Direction="In" Name="tradeNameStartsWith">
      <TypeDescriptor TypeName="System.String" Name="TradeName" AssociatedFilter="TradeName" />
    <Parameter Direction="Return" Name="TradeProducts">
    <MethodInstance Type="Finder" ReturnParameterName="TradeProducts" ReturnTypeDescriptorName="ArrayOfTradeProduct" ReturnTypeDescriptorLevel="0" Name="GetTradeProductsInstance" />