You need to sign in to do that
Don't have an account?
Filter functionality using Like in soql
Hi,
How to filter records where customer type= M in soql query. here i am getting all account records but i need filetring based on customer type.
private List<Account> performSearch(string searchString) {
String soql = 'select id, name from account where Customer_Type__c in ('M')';
if(searchString != '' && searchString != null)
soql = soql + ' where name LIKE \'%' + searchString +'%\'';
soql = soql + ' where Customer_Type__c LIKE \'%' + searchString +'%\'';
soql = soql + ' limit 25';
System.debug(soql);
return database.query(soql);
}
Regards,
Billi
Hi,
Use this in starting:
String soql = 'select id, name from account where Customer_Type__c ='+'\''+'M'+'\'';