You need to sign in to do that
Don't have an account?
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)
{
ScheduledSMS();
}
@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 ';
obj.onSend();
}
}
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 ,
Rajesh
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:- http://mrjavascript.blogspot.in/
http://screen-magic.com/resources/programmers-guide/sample-illustrations/how-to-schedule-sms
The above link may help u......
Thanks Hitesh Patel and Subra.J
Rajesh