• #19605
    Salesforce | Saurabh Saurabh #132

    What is Database.AllowCallouts in Salesforce?

    What is Database.AllowCallouts in Salesforce?


    Salesforce | Suraj Suraj #163

    Hi Saurabh,

    It is used to allow Callouts in batch Apex, “Callouts include HTTP requests as well as methods defined with the webService keyword“. Syntax is:

    global class SearchAndReplace implements Database.Batchable<sObject>,Database.AllowsCallouts{

    Salesforce | Manpreet Manpreet #232

    Hi saurabh,

    Database.AllowCallouts are used to allow Callouts in batch Apex, “Callouts include HTTP requests as well as methods defined with the webService keyword”. To use a callout in batch Apex, specify Database.AllowsCallouts in the class definition. For example:

    global class SearchAndReplace implements Database.Batchable<sObject>, Database.AllowsCallouts{

    For further details refer to this link :


    Salesforce | Louis Louis #26

    Hi Saurabh,

    Database.AllowCallout helps in integrate salesforce with external server by making a call to an external web service .

    If you want to integrate other party then we have to use Database.AllowsCallouts interface. It is used to allow Callouts in batch Apex Callouts include HTTP requests as well as methods defined with the web Service keyword.


    public class AsyncExecutionExample implements Queueable, Database.AllowsCallouts {

    public void execute(QueueableContext context) {

    //your code including the callout



    global class insert  implements Database.Batchable<sObject>,Database.AllowsCallouts{

    Global class insert implements database.batchable<sobject>,Database.AllowCallouts{


    Callouts includes http requests as well as methods defined with the web service keyword.





    To use HTTP Callouts in batch class we need to use Database.allowcallouts in an interface.

    global class BatchName implements Database.Batchable<sObject>,Database.AllowsCallouts {




    Hey Folks,

    I have a quick question….Can we use Database.allowcallouts inteface in class without using Database.batchabale interface?

    And How to write  test class for a class implementing only Database.allowcallouts.

Viewing 6 posts - 1 through 6 (of 6 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?