Today's Offer - Salesforce Certification Training - Enroll at Flat 10% Off.

- Salesforce Blogs -

Queueable Apex Job

Queueable job that add 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 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 helps in increasing some governor limits are higher than for synchronous Apex, such as heap size limits.

Read: How to Create Visualforce Page in Salesforce

Queueable jobs and future methods both are queued for execution, but Queueable jobs provide you with these additional benefits.

  • Getting an ID for your job:
  • When you submit your job by invoking the System. Enqueue Job method, the method returns the ID of the new job.
  • Using non-primitive types:
  • It contain some variables of non-primitive data types, such as sObjects or custom Apex types. Those objects can be accessed when the job executes.
  • Chaining jobs: You can chain one job to another job by starting a second job from a running job. Chaining jobs is useful if you need to do some processing that depends on another process to have run first.

salesforce Curriculum Things to Remember

Read: What is Escalation Rules? Salesforce Escalation Rules Tutorial Guide
  1. The execution of a queued job counts once against the shared limit for asynchronous Apex method executions.
  2. enqueue Job can add up to 50 jobs to the queue with in a single transaction.
  3. When chaining jobs, you can add only one job from an executing job with System. Enqueue Job, which means that only one child job can exist for each parent Queueable job.
  4. No limit is enforced on the depth of chained jobs, which means that you can chain one job to another job and repeat this process with each new child job to link it to a new child job. However, for Developer Edition and Trial orgs, the maximum stack depth for chained jobs is 5.

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);

Queueable Apex Job Queueable Apex Job  

Read: Salesforce Integration with SharePoint and LinkedIn

    Janbask Training

    JanBask Training is a leading Global Online Training Provider through Live Sessions. The Live classes provide a blended approach of hands on experience along with theoretical knowledge which is driven by certified professionals.


Trending Courses

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53

Upcoming Class

8 days 14 Dec 2019

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing

Upcoming Class

9 days 15 Dec 2019

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning

Upcoming Class

9 days 15 Dec 2019

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation

Upcoming Class

-0 day 06 Dec 2019

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

14 days 20 Dec 2019

Course for testing

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

18 days 24 Dec 2019

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing

Upcoming Class

3 days 09 Dec 2019

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum

Upcoming Class

-0 day 06 Dec 2019

SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design

Upcoming Class

3 days 09 Dec 2019

Comments

Search Posts

Reset

Receive Latest Materials and Offers on Salesforce Course

Interviews