In Salesforce Apex, future methods run asynchronously and have different execution contexts than regular methods. By default, future methods cannot
make HTTP callouts to external web services for security and resource management reasons.
When you attempt to make an HTTP callout from a future method without the callout=true parameter, Salesforce will throw a runtime
exception. This happens because the platform needs explicit permission to allow network operations from asynchronous contexts.
The callout=true parameter tells the Salesforce platform that this future method is authorized to make external HTTP requests. Without
this parameter, any attempt to use HTTP classes like Http, HttpRequest, or HttpResponse will fail at runtime,
potentially breaking your application’s functionality.
This restriction exists because HTTP callouts consume system resources and can affect performance. By requiring explicit declaration, Salesforce
ensures developers are intentional about which asynchronous methods can access external services.
What is the potential impact?
Without the callout=true parameter, the application will throw a runtime exception when the future method attempts to make HTTP
callouts. This can cause:
- Integration failures with external systems
- Incomplete business processes that depend on external data
- Poor user experience due to unexpected errors
- Difficult debugging since the error occurs asynchronously