You need to sign in to do that
Don't have an account?
ales.p
LIKE operator in a rerender DataTable action
I would like to implement a simple contact search with VisualForce and I didn't find syntax documentation about query LIKE operator.
Actually I created 3 objects: 1 simple "inputText", 1 "commandButton" and 1 "dataTable" for search contacts results.
Users should insert a search key in the inputText field, press the commandButton and obtain a list (dataTable) of contacts that matches the search key.
Actually it works fine with a "=" operator but I would like to extend this search with a LIKE operator.
String searchKey = 'Josh Davis';
public List<Contact> getMyContacts() {
return [SELECT Id, Name, Account.Name, Phone FROM Contact
WHERE Name = :searchKey
ORDER BY Name];
}
return [SELECT Id, Name, Account.Name, Phone FROM Contact
WHERE Name = :searchKey
ORDER BY Name];
}
How to do that?
Thanks a lot.