Community
Showing results for 
Search instead for 
Do you mean 
Reply

Filtering Sub Entities Still Reurns All Records

Accepted Solution Solved
Nickel Super Contributor
Posts: 441
Country: UK
Accepted Solution

Filtering Sub Entities Still Reurns All Records

I'm trying to use a 'starts with' filter on my sub entities.  For some reason it is returning all records.  Anyone have any idea what I'm doing wrong.  TIA.

 

Im trying to filter sub entities using the code below but it keeps returning all entities regardless of what data is in them.  Anyone have any ideas why, TIA.
 'create the criteria
            Dim Criteria() As StartsWithFilter = {New StartsWithFilter(filterField.Name, searchText)}
            'get the entities
            Dim sList As Act.Framework.CustomEntities.CustomEntityList(Of SubEntity)
            sList = manager.GetCustomEntities(Nothing, Criteria)
Public Class StartsWithFilter
        Implements Act.Framework.IFilterCriteria
        Private SQLClause As String
        Public Sub New(ByVal fieldName As String, ByVal searchText As String)
            SQLClause = "[" & fieldName & "] LIKE ('" & searchText & "%')"
         End Sub
        Public Function GetClause() As String Implements Act.Framework.IFilterCriteria.GetClause
            Return SQLClause
        End Function
    End Class

Accepted Solutions
Solution
Accepted by topic author Tdavis
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 59
Country: USA

Re: Filtering Sub Entities Still Reurns All Records

The CustomEntities class doesn't call the GetClause method from the IFilterCriteria interface. In fact I'm not sure how it uses the IFilterCriteria interface. The only filters I've been able to use with CustomEntities are DateFilterCriteria, InFilterCriteria, NotInFilterCriteria and ComparisonFilterCriteria. As far as I know, implementing the IFilterCriteria doesn't work.
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com

View solution in original post


All Replies
Solution
Accepted by topic author Tdavis
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 59
Country: USA

Re: Filtering Sub Entities Still Reurns All Records

The CustomEntities class doesn't call the GetClause method from the IFilterCriteria interface. In fact I'm not sure how it uses the IFilterCriteria interface. The only filters I've been able to use with CustomEntities are DateFilterCriteria, InFilterCriteria, NotInFilterCriteria and ComparisonFilterCriteria. As far as I know, implementing the IFilterCriteria doesn't work.
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Nickel Super Contributor
Posts: 441
Country: UK

Re: Filtering Sub Entities Still Reurns All Records

Thanks Hugo.

 

Tom