• yuvrajindia
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 9
    Replies
Hello all, If any one know about the SMS Provider or Code which we can use from apex class to send SMS. Also what is best to send SMS from salesforce :SOAP API,XML,html,http or http ??? Thanks in advance Yuvraj

 

        String  strXML ='<?xml version="1.0" encoding="utf-8"?><clickAPI><sendMsg><api_id>3253451</api_id><user>Medlert</user><password>Password</password><to>919826471817</to><text>SMS Message</text></sendMsg></clickAPI>';
        String strUrl = 'http://api.clickatell.com/xml/xml';

       
       HttpRequest req = new HttpRequest();

       
        req.setBody(strXML);
        req.setMethod('POST');
        req.setEndpoint(strUrl);
        req.setHeader('Content-Type', 'text/xml');
        req.setHeader('X-If-No-Redirect', '1' );
        
        Http http = new Http();
        HTTPResponse res = http.send(req);

 I am useing this code but this is throw exeption:

 

System.CalloutException: Callout from triggers are currently not supported

 

Also use this code from globel class with webservice but then how can i call that class.

 

What is currect way to run this code.

 

 

Hello i can parse this xml  in salesforce i need to use this wsdl can any one help .

 

http://api.clickatell.com/soap/webservice.php?wsdl

 

Thanks in advance !!!

My batch run is going to late every time any one help me who use this cron job application.

or any ther solution i want to run code every 1 hour.

Batch schedule has only 10 limit so i can't use this.

Thanks in advance.
Bhup

Hello all, If any one know about the SMS Provider or Code which we can use from apex class to send SMS. Also what is best to send SMS from salesforce :SOAP API,XML,html,http or http ??? Thanks in advance Yuvraj

 

        String  strXML ='<?xml version="1.0" encoding="utf-8"?><clickAPI><sendMsg><api_id>3253451</api_id><user>Medlert</user><password>Password</password><to>919826471817</to><text>SMS Message</text></sendMsg></clickAPI>';
        String strUrl = 'http://api.clickatell.com/xml/xml';

       
       HttpRequest req = new HttpRequest();

       
        req.setBody(strXML);
        req.setMethod('POST');
        req.setEndpoint(strUrl);
        req.setHeader('Content-Type', 'text/xml');
        req.setHeader('X-If-No-Redirect', '1' );
        
        Http http = new Http();
        HTTPResponse res = http.send(req);

 I am useing this code but this is throw exeption:

 

System.CalloutException: Callout from triggers are currently not supported

 

Also use this code from globel class with webservice but then how can i call that class.

 

What is currect way to run this code.

 

 

Hello i can parse this xml  in salesforce i need to use this wsdl can any one help .

 

http://api.clickatell.com/soap/webservice.php?wsdl

 

Thanks in advance !!!

Hi Folks,

 

Requirement: To create a Schedule/Cron/Code job which executes after a specific interval, say after every 1 minute.

 

There is no direct feature in SFDC of doing it but with a tricky way.

Step 1: Create an Apex class which contains the business logic which is required to be executed after specific intervals.

Step 2: Create a Scheduleable Apex Class Like below:

 

global class ScheduleChatter implements Schedulable {
    global void execute(SchedulableContext SC)  {                 

        //The line of code below would contain the required business logic

        TestChatter.initGoogleApp();

        System.debug('-----------ScheduleChatter---------');

        String hour = String.valueOf(Datetime.now().hour());

        String min = String.valueOf(Datetime.now().minute() + 1);

        String ss = String.valueOf(Datetime.now().second()); 

        
String nextFireTime = ss + ' ' + min + ' ' + hour + ' * * ?';

        System.debug('-----------nextFireTime---------' + nextFireTime);

        

ScheduleChatter s = new ScheduleChatter();

         System.schedule('Job Started At ' + String.valueOf(Datetime.now()), nextFireTime, s);

        

}   

}

 

Step 3: This Schedule job is initiated by a code, which can be run on System log screen or via another trigger/class:

ScheduleChatter s = new ScheduleChatter();

String hour = String.valueOf(Datetime.now().hour());

String min = String.valueOf(Datetime.now().minute());

String ss = String.valueOf(Datetime.now().second());

String nextFireTime = ss + ' ' + min + ' ' + hour + ' * * ?';

system.schedule('Start me once', nextFireTime, s); 

 

The Schedulable class will keep on calling itself after every 1 minute and eventually calls the code which is needed to be called after specified interval of time.

 

This code is written as part of R&D.

 

Thanks,

Sam

Current documents has no example on how to schedule apex jobs every 10 mins. I tried with unix cron job syntax style (like 0,10,20,30,40,50 slots), that doesn't work.

 

Any help would be appreciated.

 

Thanks

  • February 17, 2010
  • Like
  • 0

 Hello,

 

I have a process that automatically builds a scheduled job a few minutes in the future every time it fires.  This works great, but after there are ten such jobs, I get an Apex limit exception: You have exceeded the maximum number (10) of Apex scheduled jobs.

 

These jobs are all completed and I did check to make sure they have a status of 'COMPLETED' as well.  When I delete them by going in through the UI, then the process works again.

 

1. Is this intended behavior? 

 

2. Is there any way to programatically delete these old completed jobs?

Message Edited by jhartfield on 02-12-2010 02:35 PM
Message Edited by jhartfield on 02-12-2010 02:35 PM