function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Elad Kaplan 3Elad Kaplan 3 

Picklist SOQL 'Like' operation

I'm trying to query for records, filtered by picklist values but can't do it.

I have a page where I have a search box, when the user insert a letter I have an apex:actionSupport that needs to get all the records where picklist values containing  this letter (or more than 1 letter) .

For example - If I have records of 'Case' where I'm looking for the field 'Status' and one of the values is 'New' and the user inserts 'Ne' to the search box, I want to query all the 'Case' records where their Status is 'New' ..

Can anybody help ?
Best Answer chosen by Elad Kaplan 3
sandeep sankhlasandeep sankhla
Hi Elad,

Can you share your code what you haev done already, so I can correct the mistake...Else I will provide the query for the same.

Thanks,
Sandeep

All Answers

sandeep sankhlasandeep sankhla
Hi Elad,

Can you share your code what you haev done already, so I can correct the mistake...Else I will provide the query for the same.

Thanks,
Sandeep
This was selected as the best answer
Elad Kaplan 3Elad Kaplan 3
Found It!!  Thanks Sandeep !

list<ContentVersion > allVerions_List = [SELECT Id, Title, Product__c FROM ContentVersion WHERE Product__c includes (:choenSearchedProductDetail)];
sandeep sankhlasandeep sankhla
Hi Elad,

Please refer the below link for using LIKE operator in your queryies...
http://salesforcedeveloperblog.blogspot.in/2011/07/like-operator-in-soql.html


Example:
 the following query matches Appleton, Apple, and Appl, but not Bappl:
SELECT Id, Name FROM Widget__c WHERE Name LIKE 'appl%'

Thanks
Sandeep