According to the Execution Governors and Limits the limits for either synchronous or asynchronous transactions can vary, that is why I would like to check whether my current apex transaction is asynchronous. Is there any way in apex to accomplish this?
Apex – Determine if Transaction is Asynchronous
Related Topic
- Apex Governor Limits – System.enqueueJob in Asynchronous Apex, Documentation Issue?
- [SalesForce] How is calculated “24-hour period” for the limitation of Asynchronous Apex Executions
- Apex Governor Limits – What Exactly is the Execution Time Limit of 10 Minutes?
- Apex REST API – Maximum Records Insertable via Apex REST POST Method
- Apex – Why CDC Has All Sync Limits Being an Async Process
Best Answer
Yes. The
System
class offers four methods you can call to determine if you're in Asynchronous Apex and, if so, which type: