Tag Archives: Force.com
LIKE operator in SOQL against set of strings
Set <String> accNames = new Set <String> {'Test%', 'Sample%'}; List <Account> accList = [SELECT Id FROM Account WHERE Name LIKE : accNames];
Related list Button Edit/Delete/View is not working in VF Page on Service Cloud Console
If showHeader="false"
in VF Page, the related list Button Edit/Delete/View won’t work on Service Cloud Console.
When showHeader
is set to false, some important JS files needed for the service cloud console to function properly will not be loaded, and hence you may see some issues. It is recommended to leave showHeader
as true while using in the service cloud console.
What is the return type of a SOSL search in Salesforce?
The return type of a SOSL search is List of List of sObjects.
Sample Code:
List<List<SObject>> searchList = [FIND 'map*' IN ALL FIELDS RETURNING Account (Id, Name), Contact, Opportunity, Lead]; Account [] accounts = ((List<Account>)searchList[0]); Contact [] contacts = ((List<Contact>)searchList[1]); Opportunity [] opportunities = ((List<Opportunity>)searchList[2]); Lead [] leads = ((List<Lead>)searchList[3]);
Formula field to find day of the week in Salesforce
Sample Code:
CASE(
MOD(TODAY() – DATE(1900, 1, 7), 7),
1, ‘Sunday’,
2, ‘Monday’,
3, ‘Tuesday’,
4, ‘Wednesday’,
5, ‘Thursday’,
6, ‘Friday’,
‘Saturday’ )