Skip to main content

#Future0 discussing

The SObjects passed to them might change, whether it is a future method or Queueable APEX. So why Queueable Apex accepts SObjects as a parameter but the #Future method does not?

 

#Salesforce #Salesforce Developer#Queueable Apex#Asynchronous Apex

2 answers
  1. Jan 15, 2024, 10:50 AM

    HI @Amit mishra

     

    please check the below one:

    • https://www.linkedin.com/pulse/explanation-why-queueable-apex-accepts-sobjects-parameters-gupta-vbmaf 
    • https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4GRxSAN
    • Queueable Apex is more flexible and capable of handling complex, stateful asynchronous processes, hence it allows SObjects as parameters.
    • Future methods are designed for simpler, stateless asynchronous processes and thus require parameters to be serializable, limiting them to primitive data types.
    • Future Method: If you pass an SObject to a future method (which you can't directly), any changes made to that record after the method call but before its execution won't be reflected in the future method's execution. Future methods are better suited for scenarios where you're dealing with immutable data, like IDs or other primitives.
    • Queueable Apex: When you pass an SObject to a Queueable job, you're effectively creating a snapshot of that object at the time of the job's initiation. If the record changes in the database after enqueuing but before execution, those changes will not be reflected in the job. However, the Queueable job has the flexibility to re-query the database to get the latest state if needed.
0/9000

Risk professional in an investment bank looking to skill myself up for the future . Any suggestions on where to start and what trail to blaze ?

1 comment
0/9000

It would be great if we have MuleSoft on Trailhead, Please vote my idea if you would like to see this in future. 

https://success.salesforce.com/ideaView?id=0873A000000PdqzQAC 

Thank You 

Dnyan

0/9000

#Trailhead  #Future Of Credentialing #LWC Question: Can we expect a superbadge for Lightning web components soon? Also, additional deep dive trailhead modules on lightning web components development?

1 comment
0/9000

The #future of your #business isn’t on your #CRM today. It’s out there, in the #real #world. It's #people who haven’t even heard of you yet. That means you need to #focus on #building a serious system for #acquiring new #customers today to grow your business tomorrow.

0/9000

I missed when Joined reports would be in Lightning.   All the information I can find shows "Future".  Did the webinar give a more definite go-live date?

3 comments
0/9000