Hi all,
I am modifying search functionality, I have the code:
Dim newFilter As IPredicateExpression
For i = 0 To splitSearch.Length - 1
If i = 0 Then
newFilter = New PredicateExpression(PredicateFactory.Like(SupplierFieldIndex.SupplierName, "%" & splitSearch(i) & "%"))
Else
newFilter.AddWithAnd(PredicateFactory.Like(SupplierFieldIndex.SupplierName, "%" & splitSearch(i) & "%"))
End If
newFilter.AddWithOr(PredicateFactory.Like(SupplierFieldIndex.SupplierAddressTown, "%" & splitSearch(i) & "%"))
Next
But this doesn't do what I want.
I want to have something that acts like this:
If (subString 1 matches A OR subString 1 matches B)
AND (subString 2 matches A OR subString 2 matches B)
...
But I get something that acts like this:
If subString 1 matches A
OR (subString 1 matches B AND subString 2 matches A)
OR subString 2 matches B)
...
Is there any way to change the order of evaluation of AddWithOr and AddWithAnd?
Thanks,
James