• Sumit jaitly
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hi All,

Could you please let me know , how can we run a batch class which are containing callouts, on Scheduled Apex.
when i am running batch process on click event It is working fine but when i scheduled it the it is giving me error like 'callouts is not allowed at Scheduled Apex. '

Regards
Sumit
Hi ALL,

I am migrating my leagay Lotus Notes application data into salesforce and i stuck with Saleforce call out maximum limit 100.

Scnerio is:

I have to call a new Rest API each time to fetch JSON of one record.

and there we are having near about 50000 records in the Lotus notes application.

 so please provide your support or suugetion to over come this issue.

can we use apex batch? 

Regards
Sumit
Hi All

I am trying to get knowledge about Escape Notes tool, could you please help me to provide any pdf , web link and any free trial version of this tool.

Regards
Hi ALL,

I am migrating my leagay Lotus Notes application data into salesforce and i stuck with Saleforce call out maximum limit 100.

Scnerio is:

I have to call a new Rest API each time to fetch JSON of one record.

and there we are having near about 50000 records in the Lotus notes application.

 so please provide your support or suugetion to over come this issue.

can we use apex batch? 

Regards
Sumit

Hi,

 

How to create custom object and custom object fields using Apex code.

 

Is this possible?

 

Thanks,

Yarram.

  • December 11, 2013
  • Like
  • 0

Can any body help me when do we use Time based work flows and when do we use Schedule apex....? and also Difference between Time based workflows and schedule apex......?

  • September 15, 2013
  • Like
  • 0

Hi All,

I am calling a batch class (with Database.AllowsCallouts) from a Scheduler class. The batch class is making http callouts. Both classes are using Apex version 27.0.

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {

String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);

}

}

 

In my developer environment, the above code is working just fine. However when I deploy it to production (as part of a managed package) and run the scheduled class, I am getting the error:

"Callout from scheduled Apex not supported"

 

Why it works without issues in dev but not in production? Do I need to do anything in the production environment to get it working?


I have also tried the following variation of the scheduler class:

 

global class MyScheduler implements Schedulable {
global void execute(SchedulableContext sc) {
runBatchProgram();
}

 

@future (callout=true)
static void runBatchProgram() {
String query = 'Select .....';

MyBatchClass batchApex = new MyBatchClass(query);
ID bpid = Database.executeBatch(batchApex);
}


}

 

With this I get the error: Database.executeBatch cannot be called from a batch or future method.

 

Any help is appreciated as I am stuck.

 

Madhav