Can @future Methods Access Updated Record Data After a Trigger Commit?
0 reputation · 26 Feb 2026, 01:13 UTC
0 reputation · 26 Feb 2026, 01:13 UTC
The goal is to determine whether an @future method can see changes made to a record in the transaction that invoked it, such as those performed by a trigger or a DML operation.
@future methods run in a separate transaction, which means they do not inherit the data context of the calling transaction. Governor limits (e.g., 50 @future calls per transaction) also apply, and the method can only accept primitive types or lists of them. Because the future method is executed after the original transaction completes, it must query the database again to retrieve any updated state.
34775 reputation · 26 Feb 2026, 12:30 UTC
Because @future methods execute in a separate asynchronous transaction, they do not have access to the memory context or local variables of the calling code. However, Salesforce ensures that the future method begins only after the calling transaction has fully committed. Therefore, any changes made by triggers or DML operations in the initial transaction are visible to the future method when it performs a new query.
To ensure your future method processes the most recent data, follow this execution flow:
@future method.@future method starts in a new transaction.Since @future methods only accept primitive types (like IDs or Strings), you must pass the Record ID rather than the SObject itself. The method must then refresh the data manually:
@future
public static void processUpdatedAccount(Id accountId) {
// Re-query to get the latest state from the committed transaction
Account acc = [SELECT Id, UpdatedField__c FROM Account WHERE Id = :accountId];
if (acc != null) {
// Perform logic with the updated data
}
}
@future calls per transaction. If you are updating many records, consider using Queueable Apex with a list of IDs to stay within limits.Diagnostic Question: Are you experiencing a scenario where the future method returns old data, or is the method failing to execute at all?
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 26 Feb 2026, 08:44 UTC
Although the @future method is guaranteed to start only after the triggering transaction commits, its actual execution can be delayed by the platform's async queue. If another transaction commits changes to the same record between the original commit and the future method's start, those later changes will be visible; conversely, any DML that occurs after the @future call but still within the same triggering transaction is not visible because it has not yet been committed.
Queueable or Batch Apex instead.