I am using an OData web service with BCS (testing with Northwind) and I would like to define some filters when using the External Data picker. I'd like to be able to have a drop down that then performs the lookup based on an OData filter, like filter=substringof("Value",Field_Name).
The filter is working when I create a VIEW on an EXTERNAL LIST app. However, when trying to use it in the EXTERNAL DATA COLUMN Picker, the filter options do show up in the dropdown, but do not return any results. Instead I always get this error message:
The same results from the External List VIEW
The code I am using to add to my "ReadAllCustomers" method include: (1) The Filter Descriptor
<!-- ********* this is NOT working *********** -->
<FilterDescriptor Name="CustomerIDFilter" FilterField="CustomerID" Type="Wildcard">
<Properties>
<Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
<Property Name="IsDefault" Type="System.Boolean">true</Property>
<Property Name="CaseSensitive" Type="System.Boolean">false</Property>
<Property Name="LogicalOperatorWithPrevious" Type="System.String">And</Property>
</Properties>
</FilterDescriptor>
<!-- ********* this is working *********** -->
<FilterDescriptor Name="CustomerIDCompare" FilterField="CustomerID" Type="Comparison">
<Properties>
<Property Name="IsDefault" Type="System.Boolean">false</Property>
<Property Name="Comparator" Type="System.String">Equals</Property>
<Property Name="LogicalOperatorWithPrevious" Type="System.String">Or</Property>
</Properties>
</FilterDescriptor>
(2) The Input Parameter
<!-- ********* this is NOT working *********** -->
<Parameter Name="@CustomerIDFilter" Direction="In">
<TypeDescriptor Name="CustomerIDFilter" TypeName="System.String" AssociatedFilter="CustomerIDFilter">
<Properties>
<Property Name="ODataFilterUrl" Type="System.String">substringof('@CustomerIDFilter',CustomerID)</Property>
</Properties>
<DefaultValues>
<DefaultValue MethodInstanceName="ReadAllCustomer" Type="System.String"></DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<!-- ********* this is working *********** -->
<Parameter Name="@CustomerIDCompare" Direction="In">
<TypeDescriptor Name="CustomerIDCompare" TypeName="System.String" AssociatedFilter="CustomerIDCompare">
<Properties>
<Property Name="ODataFilterUrl" Type="System.String">CustomerID%20eq%20'@CustomerIDCompare'</Property>
<Property Name="LogicalOperatorWithPrevious" Type="System.String">None</Property>
</Properties>
<DefaultValues>
<DefaultValue MethodInstanceName="ReadAllCustomer" Type="System.String"></DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
(3) The ODataEntityUrl which applies the filter as determined by the parameter input
<Property Name="ODataEntityUrl" Type="System.String">/Customers?$top=@LimitCustomers&$filter=@CustomerIDFilter%20or%20@CustomerIDCompare</Property>
Again, with these snippets, the filters work like a charm when creating a view and entering the values, but I cannot for the life of me get it to work with the filter drop downs.
Anyone know how to do this or have examples of working ones that I can copy from?