function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
Please some one let me know for apex scheduler with sample codeapex
Assuming it is a batch class called ContactTotals this would make a class available to schedule via the UI:
global class bfc_scheduledctotalrefresh implements Schedulable{ global void execute(SchedulableContext sc) { ContactTotals ctotal = new ContactTotals(); ID batchprocessid = Database.executeBatch(ctotal); } public static testMethod void testschedule() { Test.StartTest(); bfc_scheduledctotalrefresh sh = new bfc_scheduledctotalrefresh(); String sch = '0 0 23 * * ?'; system.schedule('Contact Total Update', sch, sh); Test.stopTest(); } }
Just to add up, the class should implement Schedulable interface to be scheduled.
Ah - thanks Imran - missed that rather crucial first line in my cut and paste - have updated to include the missing first line Imran refers to
Assuming it is a batch class called ContactTotals this would make a class available to schedule via the UI:
Just to add up, the class should implement Schedulable interface to be scheduled.
Ah - thanks Imran - missed that rather crucial first line in my cut and paste - have updated to include the missing first line Imran refers to