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">
  <FilterDescriptors>
    <FilterDescriptor Type="Wildcard" Name="TradeName">
      <Properties>
        <Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
      </Properties>
    </FilterDescriptor>
  </FilterDescriptors>
  <Parameters>
    <Parameter Direction="In" Name="tradeNameStartsWith">
      <TypeDescriptor TypeName="System.String" Name="TradeName" AssociatedFilter="TradeName" />
    </Parameter>
    <Parameter Direction="Return" Name="TradeProducts">
      ...
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="Finder" ReturnParameterName="TradeProducts" ReturnTypeDescriptorName="ArrayOfTradeProduct" ReturnTypeDescriptorLevel="0" Name="GetTradeProductsInstance" />
  </MethodInstances>
  ...

Comments