Loading

'Callout from triggers are currently not supported' error

Publiseringsdato: Jun 25, 2026
Beskrivelse
In certain scenarios, we need to make the callout from the trigger to call an external webservice however we are not able to do so as it gives the below mentioned error:

Callout from triggers are currently not supported.



 
Løsning

Use @future Methods for Callouts


To invoke a callout from a trigger in Salesforce Apex, wrap the callout logic in a @future method with the callout=true annotation. The @future annotation (Apex Future Annotation) marks a method to run asynchronously, meaning the callout occurs after the triggering transaction has completed.


For example, define a global class named MyClass with a static method annotated @future(callout=true). Inside that method, include the long-running Apex callout code. The annotation takes the format: @future (callout=true), followed by a public static void method that accepts serializable parameters such as Strings or primitive types.

 

global class MyClass {
     @future (callout=true)
     Public static void myMethod(String a)
     {
          //long-running Apex code
     }
}

Note: This approach only works if your required operation can be performed asynchronously, since @future methods do not return values to the triggering transaction.


Governor Limits for @future Methods

Future methods are subject to the following Apex governor limits:

  • Maximum SOQL queries per future method invocation: 200

  • Maximum heap size per future method invocation: 12 MB

  • Maximum @future method calls per Apex invocation: 50

  • Organization-wide limit on asynchronous method invocations (including Batch Apex, Queueable Apex, Scheduled Apex, and future methods): 200 method calls per full Salesforce user license or Force.com App Subscription license, per 24-hour period. Chatter Only, Customer Portal User, and Partner Portal User licenses are not counted toward this limit.

 


 

Knowledge-artikkelnummer

000386018

 
Laster
Salesforce Help | Article