An asynchronous process is a process or function that executes a task "in the background" without the user having to wait for the task to finish.
Asynchronous runs in salesforce different four types :-- Future Methods:- Run in their own thread, and do not start until resources are available.
- Batch Apex:- Run large jobs that would exceed normal processing limits.
- Queueable Apex:- Similar to future methods, but provide additional job chaining and allow more complex data types to be used.
- Scheduled Apex:- Schedule Apex to run at a specified time.
Future Methods
- It's start always @future annotation before create a future method.
- It's is used for only long-running operation.
- It's runs always separate thread.
- It's method must be static and return type void.
- It's method parameter always should premitive data type like (Id, string, Interer, boolean), because the sObject might be changed in future when method will be execute. In this case future method will get old sObject value and might be overwrit them.
Queueable Apex class
- Queueable apex clsss is a interface that is control the asynchronous process of apex process.
- It is a advance version of future method, it enhanced way of running asynchronous apex code compare to the using future method.
- It always run in background in it's own thread and doesn't delay the execution of your main apex logic.
- It implementing the queueable interface and adding a job to the apex job queue.
- Each queue job runs when system resource become available.
Batchable Apex class
- Batchable Apex is a interface of three method. We must implement "Database.batchable"
1) Start method
2) Execute method
3) Finish method - Start method:- Start method is automatically called at the begning of the apex job. this method will collect the record of the object.
- Execute method:- Execute method performe an operation which we want to perform on the record fetched from start method.
- Finish Method:- Finish method execute after all batches are processed. Use this method send confirmation email notification.
To know more live demo source code in Salesforce lightning, Trigger, Visualforce & LWC, Use this link..
Asynchronous Processing in Salesforce
Reviewed by Admin
on
1:31 AM
Rating:
read your and i really find it helful. Thanks for sharing such amazing articles with us
ReplyDeletebest news website https://royalkastoori.com
ReplyDeleteyour article is awesome.
ReplyDeleteGreat Thanks for sharing awesome info. I have a information about fake ID card. Idsbuddy is 𝐛𝐞𝐬𝐭 𝐟𝐚𝐤𝐞 𝐢𝐝 𝐦𝐚𝐤𝐞𝐫 𝐰𝐞𝐛𝐬𝐢𝐭𝐞𝐬. You can learn more information about fake id card from this website.
you can check best fake id websites
Nice Article
ReplyDelete5 Internet Approval Site (Do Follow Backlinks)
Hello guys nice post this and thanks for sharing this content in this blog..matka
ReplyDeleteyour article is awesome.
ReplyDeleteGreat Thanks for sharing awesome info....
buy Google voice number
Twitter pva accounts
Buy Instagram pva accounts
Buy Facebook pva accounts
this is a really nice post
ReplyDelete