12
MarA Queueable job that adds the job to the queue and each job runs when system resources become available.
Apex processes that run for a long time, such as extensive database operations or external Web service callouts, you can run them asynchronously by implementing the Queueable interface and adding a job to the Apex job queue Queueable Apex job runs in the background in its own thread and doesn’t delay the execution of your main Apex logic. Each queued job runs when system resources become available. Queueable interface methods help in increasing some governor limits are higher than for synchronous Apex, such as heap size limits.
Queueable apex jobs and future methods both are queued for execution, but Queueable jobs provide you with these additional benefits.
Read: A Definitive Guide in 2020 to Batch Apex Class in Salesforce
Enroll for an online Salesforce Training and become a Salesforce expert in just a matter of 6 weeks.
Sample Code:
public class QueueableExample implements Queueable {
public void execute(QueueableContext context) {
Account a = new Account(Name='Daniel',Phone='(+12) 354-45345');
insert a;
}
}
Debug
ID jobID = System.enqueueJob(new QueueableExample());
system.debug(jobId);
Read: Salesforce Marketing Cloud: A Powerful Marketing Platform
Now learn Salesforce at your own pace with our Salesforce Self-learning program.
Learn Salesforce in the Easiest Way
Read: What is Inbound Email Service in Salesforce?
Did you understand what Queueable Apex in Salesforce is about? Go to Janbask Training to learn more about Salesforce and its aspects. Also, sign up for a Salesforce course to have an in-depth understanding of it.
A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.
AWS
DevOps
Data Science
Hadoop
Salesforce
QA
Business Analyst
MS SQL Server
Python
Artificial Intelligence
Machine Learning
Tableau
Search Posts
Trending Posts
What is SFDC? What does SFDC stand for?
907
What Is The Difference Between Tables And Views In SQL?
562
How to Add A New Column to a Table in SQL?
540
What is the SQL Insert Query? How to Insert (Date, Multiple Rows, and Values in Table)
448
What Is SQL Candidate Key? Difference between Primary Key & Candidate Key
362
Related Posts
Apex:Actionfunction In The Salesforce VisualForce Page
209.2k
What is Inbound Email Service in Salesforce?
640.2k
A Comprehensive Guide for Salesforce Certification Preparation
57
Salesforce Tutorial – An Ultimate Guide for the Beginners
540k
What Are Sharing Rules? How To Create Sharing Rules In Salesforce?
239.5k
Receive Latest Materials and Offers on Salesforce Course
Interviews