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];
Set <String> accNames = new Set <String> {'Test%', 'Sample%'}; List <Account> accList = [SELECT Id FROM Account WHERE Name LIKE : accNames];
Batch Class:
global class accountBatch implements Database.Batchable<sobject> { global Database.QueryLocator start(Database.BatchableContext bc){ String query = 'SELECT Id, Name FROM Account'; return Database.getQueryLocator(query); } global void execute(Database.BatchableContext bc, List<account> scope) { for(Account a : scope) { a.Name = a.Name + 'Updated'; } update scope; } global void finish(Database.BatchableContext bc) { } }
Scheduled Class:
global class accountBatchSchedule implements Schedulable{ global void execute(SchedulableContext sc) { //invoke the batch class Database.executeBatch(new accountBatch()); } }
Execute below code from anonymous window in developer console. This will scheduled the job to run in every hour starting from 12:00 AM.
accountBatchSchedule sc = new accountBatchSchedule(); //Define cron expression String cronExp = '0 0 * * * ?'; String jobID = System.schedule('Update Account', cronExp, sc);
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.
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]);
Sample Code:
CASE(
MOD(TODAY() – DATE(1900, 1, 7), 7),
1, ‘Sunday’,
2, ‘Monday’,
3, ‘Tuesday’,
4, ‘Wednesday’,
5, ‘Thursday’,
6, ‘Friday’,
‘Saturday’ )