SharePoint 2013 BCS using a comparison filter on a System.Nullable field

SharePoint 2013 bcs error 1.png

In this article we explore External Content Type how to apply a comparison filter on a System.Nullable<System.Int32> in BCS. I’m creating an External Content Type with SQL Store procedure in SharePoint 2013. I have one input parameters of the type System.Nullable<System.Int32> and I’d like to add filters of the type Comparison to these input parameters.

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.

A sample input parameter for a Read List operation,may look like this:

SharePoint 2013 bcs nullable filter
SharePoint 2013 bcs nullable filter

If you want to add a Comparison filter for this input parameter, you would probably set it up like this:


SharePoint 2013 bcs tutorial
SharePoint 2013 bcs tutorial

When you click OK, you would see an Error message in the Errors and Warning list at the bottom of the page.

It seems like SharePoint BCS is unable to cope with Nullable Int .NET data types, which would be odd, as they have been around in the .NET Framework since version 2.0.

It shows an Error message:

“The filter data type Sytem.Nullable<System.Int32> does not match data type System.Int32 on the data source element [[ElementName]].

The filter data type System.Nullable<System.Int32> does not match data type System.Int32 on the data source element
The filter data type System.Nullable does not match data type System.Int32 on the data source element

Read some SharePoint 2013 tutorials below:

Solutions:
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.


SharePoint 2013 bcs error
SharePoint 2013 bcs error

Press OK to close the Dialog and press Finish to close the Read List dialog. Save your changes to ECTs.

We configure comparison filter External Content Type ’ to Business data List.

Step 1: Navigate to your SharePoint 2013 site.

Step 2: From this page select the Site Actions | Edit Page.

Edit the page, go to the “Insert” tab in the ribbon and click the “Web Part” option. In the “Web Parts” picker area, go to the “Business data” category, select the “Business data List” Web Part and press the “Add button”.

Step 3:

SharePoint 2013 bcs tutorial
SharePoint 2013 bcs tutorial

I hope its help full….

Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →