It took me a while to find the solution for this problem, which was eventually handed to me by Dmitry Kaloshin, so I’ll share it here:
Filters in BCS are very handy, and often necessary, for reducing the amount of items when working with External Data, such as an External Data Column based on an External Content Type.
When you’re working with an external content type that has input parameters of the .NET Type System.Nullable<System.Int32>, you may run into the same problems I had.
A sample input parameter for a Read List operation, i.e. from a WCF Service, that has the System.Nullable .NET Type, may look like this:
If you’d want to add a Comparison filter for this input parameter, you’d probably set it up like this:
When you click OK, you’d see an Error message in the Errors and Warning list at the bottom of the page.
The error reads “The filter field data type System.Nullable<System.Int32> does not match data type System.Int32 on data source element [[Element name]]“.
It seems like SharePoint BCS is unable to cope with Nullable Int .NET data types, which would be odd, as they’ve been around in the .NET Framework since version 2.0.
The solution is to set the Filter Field property of the Filter to <<none>>. Since the Filter Configuration dialog is started from the Element properties panel, the Element to filter is still linked to this filter.
Press OK to close the Dialog and press Finish to close the Read List dialog.
Save your changes to the Business Data Connectivity Metadata Store, and you’re done.