function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Regarding Scheduled job

Hi everyone ,


i want to execute a scheduled job of sending sms . i am confused  in the code


my scheduled job code is as follows ,


global class TwilioSchedule_Weekly_SMS Implements Schedulable{
     global void Execute(SchedulableContext SC)
     @future (callout=true) //code that does HTTP callouts
     static void ScheduledSMS(){
     QueryResult qResult = null;
     String soqlQuery = ' SELECT  Id ,Mobile__c  FROM Account WHERE Weekly_Scheduled_SMS__c = true ';
     qResult = connection.query(soqlQuery);
     TwilioMessageController obj = new  TwilioMessageController();
     obj.messageType = 'SMS ';
     obj.messageBody = ' test test ';


i want to select all the mobile nos from the above query and send SMS to all those numbers with the message body "test tes " . help me out in the code


Thanks ,




Hi rajesh,


you have to use system.schedule() method to scheduled job of sending sms.


see below example:

Schedule Apex to run Every 24 HOUR


For more information about scheduler go to below link:

Apex Scheduler


Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
My Blog:-


Thanks Hitesh Patel and Subra.J