- February 14, 2020 at 1:43 pm #69490Shweta #7
Why sObjects can't be passed as arguments to Future method in Salesforce?
Why sObjects can’t be passed as arguments to Future method in Salesforce?February 14, 2020 at 1:47 pm #69494Marziya #6
The reason why sObjects can’t be passed as arguments to future methods is because the sObject might change between the time you call the method and the time it executes. In this case, the future method will get the old sObject values and might overwrite them. To work with sObjects that already exist in the database, pass the sObject ID instead (or collection of IDs) and use the ID to perform a query for the most up-to-date record. The following example shows how to do so with a list of IDs
Please Register to reply to this topic. /