Skip to content

Instantly share code, notes, and snippets.

View sakthivelsfdc's full-sized avatar

Sakthivel Madesh sakthivelsfdc

View GitHub Profile
global class contactUpdateFromScheduleClass implements Schedulable {
/*
This is a ScheduleClass to run every hours after 6 mins to update contact records
*/
// Execute below code in developer console
// It schedules this class to run every hour after 6 minutes (like 8:06, 9:06, 10:06, etc..)
// This is one minute after the exchange rates are fetched from Open Exchange Rates.
/*
contactUpdateFromScheduleClass contactUpdate = new contactUpdateFromScheduleClass();
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
@sakthivelsfdc
sakthivelsfdc / contactUpdateFromScheduleClassTest.cls
Last active March 2, 2020 11:06
contactUpdateFromScheduleClassTest.cls
@isTest
public class contactUpdateFromScheduleClassTest {
@isTest static void contactUpdateTest_Schedule() {
Contact cont = new Contact(FirstName ='First Name', LastName ='Last Name', Email='sakthi@theblogreaders.com');
insert cont;
// Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
String CRON_EXP = '0 6 * * * ?';