cancel
Showing results for 
Search instead for 
Did you mean: 

Searching two fields with OR Condition Using Java API.

Former Member
0 Kudos

Hi,

I have table customer and I need to search for a value which may exits in Field1 or Field2. So is there any way to search the record in a single search, insted of searching for a record with the value existence in field1 if not again researching the

field 2

Regards,

Sandeep Reddy.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandeep,

Yes there is a way to do this, try the below:

Add the search items for both the fields (fld 1 & fld 2) in the Search object that you pass to RetrieveLimitedRecordsCommand.

Once the search items are added to the Search Object, you can set the Comparison Operator to (OR) and it will check the value in the fields and if found in any one of them it will return the result.

objSearch.setComparisonOperator(Search.OR_OPERATOR);

Hope this helps!!

Cheers,

Arafat

Former Member
0 Kudos

Thanks,

I will try.

Regards,

Sandeep Reddy.

Answers (0)