Skip to main content

Questions tagged [queueable-apex]

Filter by
Sorted by
Tagged with
0 votes
2 answers
38 views

Queueable queue size limits?

I understand that the flex queue allows for a maximum of 100 batchable jobs at a time. Is there a similar limit for Queueable jobs? I’m aware of the global asynchronous limit of 250,000 jobs (or the ...
KarlLivesey's user avatar
0 votes
0 answers
29 views

What would caused the chained Queueable inside the batch to run recursively?

I have a batch that is scheduled to run daily. This batch can delete and update the records. this is the sample of my batch: public class BatchTest implements Database.Batchable<SObject>, ...
Saber's user avatar
  • 1
0 votes
0 answers
43 views

Issue with Invocable Apex that calls a Queueable Class which calls an Integration Procedure

I have a (1) Flow that calls an (2) Invocable Apex which calls a (3) Queueable class, and that class passes data to an (4) Integration Procedure. The IP does stuff with the data, and I can't not use ...
ash's user avatar
  • 1
2 votes
1 answer
52 views

Set the Maximum Depth of Chained Queueable Jobs not working?

This Set the Maximum Depth of Chained Queueable Jobs (Generally Available) is GA and documented to work in: Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, ...
Keith C's user avatar
  • 137k
2 votes
1 answer
157 views

Any clean way to delay the execution of a Queuable by 20 seconds in Apex code?

The System.enqueueJob allows a minimum delay (0–10 minutes) to be specified before the Queueable will execute: Integer delayInMinutes = 1; ID jobId = System.enqueueJob(new MyQueueableClass(), ...
Keith C's user avatar
  • 137k
0 votes
1 answer
30 views

APEX API Call after another API Call - uncommitted work pending

I am trying to create a trigger that will fetch info from DB and populate fields in SF. Problem is that I need to fetch first basic info and then with this info do another API call to fetch the rest. ...
Tom Raketak's user avatar
0 votes
0 answers
56 views

SendGrid API Callout From Flow Using Apex

I have queuable class which has a function to send out mails via sendgrid using REST API. I have created invocable apex action which is getting called from flow and is calling that queuable class ...
Bhavesh Tilvani's user avatar
0 votes
0 answers
50 views

Too many queueable jobs added to the queue with unremovable queue [duplicate]

Im in desperate mode. The situation is following: there are three objects, Account, Publisher(child of account, master-detail), app(child of publisher, master-detail). Creating/updating app in a way ...
Rostyslav Popov's user avatar
0 votes
0 answers
36 views

I'm Trying to test my Scheduled Apex Class but Im getting : System.AsyncException: Maximum stack depth has been reached [duplicate]

I'm trying to create a Test class for a Scheduled Class that calls a Queueable Class But, it gives me a System.AsyncException: Maximum stack depth has been reached. error in the test class. Queueable ...
Yassine El Moustachir's user avatar
0 votes
2 answers
187 views

Is there a way to catch System.LimitException: Apex heap size too large

We have a handler on Opportunity which has some complex logic written and cannot be refined. Lately , we are facing 'System.LimitException: Apex heap size too large: 9742590' while performing an ...
sfdcTod's user avatar
  • 47
0 votes
1 answer
118 views

Queueable callout error - uncommitted work pending

I have a queueable apex class that is supposed to create records (dml), and after those records are created successfully - send them to 3rd party system. When I'm running the test class, I get the ...
Omnia's user avatar
  • 323
2 votes
1 answer
104 views

Understanding Detecting Duplicate Behavior in Apex Queueable Jobs

In the Apex documentation on Detecting Duplicate Queueable Jobs, it mentions that attempting to enqueue more than one Queueable job with the same signature results in a DuplicateMessageException. ...
Jair's user avatar
  • 569
2 votes
2 answers
977 views

Stuck in Infinite Loop

I am calling a queueable from batch class and vice-versa. And now got stuck in the infinite loop of execution of the batch and queueable classes in the apex.How can I abort it. When I try to abort ...
NewBaySales's user avatar
1 vote
1 answer
54 views

Multiple Outbound Calls resulting in errors

Within in our SF organization, I need to send API calls to another platform when certain records are updated in Salesforce. I've successfully created triggers and apex classes (utilizing @future) to ...
IanLock's user avatar
  • 21
1 vote
0 answers
33 views

Request.getCurrent().getRequestId() returns the same id if called inside a queueable chain

So if a have a chain of queueables that send outbound messages I grab the requestId using Request.getCurrent().getRequestId() and send it with the request for uniqueness it returns the same request ID ...
KarlLivesey's user avatar
1 vote
2 answers
704 views

Platform Events a nightmare - How to make them work in real life

I am trying to build a Platform Event-based application logger where arbitrary application code calls Tracker.log(...); and this is sent as an Event into an external database via an API. As it's ...
Robert Sösemann's user avatar
1 vote
0 answers
88 views

Why is AsyncOptions.DuplicateSignature property not working in System.enqueueJob function?

i have an issue with the class QueueableDuplicateSignature. Precisely on the property DuplicateSignature of the AsyncOptions class I'm trying to create a single Job for a certain process, call it &...
ViDev's user avatar
  • 11
1 vote
1 answer
120 views

Getting 'uncommitted work pending' even after putting in a queuable class

Getting 'You have uncommitted work pending. Please commit or rollback before calling out' error even after making the callout in a queuable class. Below the essence of the logic QueuableDummyclass.cls ...
Brav's user avatar
  • 819
1 vote
0 answers
23 views

How can I avoid Maximum stack depth has been reached on multi queueable single class? [duplicate]

I'm presenting the Maximum stack depth has been reached. error only on testing, how can avoid this error if I have created this nested queueable in just one class? This is the class used. global class ...
David Paucar's user avatar
0 votes
0 answers
40 views

Best practice to deal with HATEOAS api callouts

I'm creating an connector between Salesforce and a ticketing system that exposes a REST API based on HATEOAS. I need to synchronize tickets everyday and insert/update them as Cases. Salesforce is ...
Yan Imensar's user avatar
1 vote
1 answer
87 views

Do queueables have their own governor limits?

I have a class that makes consecutive API calls. I set the timeout to the maximum value allowed by Salesforce (120 seconds) however sometimes these are timing out because of the API taking way too ...
sfNewbie's user avatar
0 votes
0 answers
30 views

run a script in the the developer console while implementing interface [duplicate]

I'm trying to run a script from the developer console with the queueable interface implemented, but the execute method isn't called. code to put in Execute Anonymous Window in the developer console: ...
Json's user avatar
  • 1,677
0 votes
0 answers
175 views

I have two Queueable Jobs running in a transaction how to resolve it

On Order Product object I have an integration with a 3rd party system, which sends data the 3rd party whenever the Order Product through Queueable class. Now I am trying to insert a set of records to ...
Akshay Vasu's user avatar
1 vote
1 answer
167 views

Configure Stack Depth of Chained Queueable Jobs

I was going through the documentation related to the new AsyncOptions class, and looks like this is still in BETA. I remember this feature was released in Summer 23 release. https://help.salesforce....
nica's user avatar
  • 1,450
0 votes
1 answer
356 views

Making a lot of chained API calls in Apex

I'm supposed to make around 1500 chained API calls in apex. This is the process: I want to get a list of courses of a semester from an external server, then for each course, I want to make a separate ...
Rose Mirzaei's user avatar
1 vote
1 answer
151 views

batch vs queueable for pseudobulkification of an app

I'm testing out an app that uses a callout to check some info in a government database and writes back any hits to a custom object. The app is designed to be used via an action on a record page, but I ...
gorav's user avatar
  • 4,557
6 votes
0 answers
220 views

Handling uncatchable exceptions from chained queueable - finalizer hitting retry limit

We have a need to process a number of records (several thousand) using methods from a third-party managed package, which also involves callouts. We've achieved this by passing in the list of objects ...
James's user avatar
  • 205
0 votes
2 answers
590 views

Is it guaranteed that First submitted Queueable or Batch class will run first?

We have to send case create and update data via API to third party. For create case: In trigger we are collecting all the case ids in set and calling queueable class if cases created are less than 100 ...
Sukruti's user avatar
  • 472
-1 votes
1 answer
99 views

Independent Bulkification vs Batched Processing

I have been acquiring quite a bit of information about how bulkification and batch record processing works in salesforce (bits and pieces - salesforce documentation does not seem exhaustive). While I ...
Luke Sharon's user avatar
0 votes
1 answer
965 views

Queueable Apex - Too many DML Rows: 10001

Looking for some help with this. This class is failing due to the following error: 'Too many DML rows: 10001'. There's approximately 30,000 thousand records the class is trying to update, but I was ...
MattcG91's user avatar
6 votes
0 answers
111 views

Why can't a Queueable use an Iterator that comes from a Set?

I saw some surprising behaviour when storing the iterator obtained from a Set<Id> as a member in a Queueable class. So, I wrote the following trivial Queueable class to investigate: public class ...
Aidan's user avatar
  • 14k
3 votes
0 answers
234 views

Transaction Finalizers do not run when Queueable is "Aborted"

In my testing, it seems as though transactions finalizers do not run when the Queueable is aborted (via Apex Job -> Abort or other means). I'm unable to find any documentation confirming this. Is ...
NSjonas's user avatar
  • 10.3k
1 vote
0 answers
114 views

How to prevent the parent Queueable Job from having a 'Complete' status until the chained child Queueable job completes?

This is more of a theoretical question. I have an action button on a VisualForce page which downloads a PDF with large data. When the action button is clicked, it invokes a Queueable job through the ...
Knight of the Vale's user avatar
2 votes
2 answers
4k views

How to run the execute method of Queueable Apex?

I want to run the execute method of a Queueable Apex class Why I want to do that: To increase debugging speed. I want to anonymously call the method to avoid always enqueuing the job, going to setup --...
Gerke's user avatar
  • 155
-1 votes
1 answer
417 views

Pass Http Get and Http Post as asynchronous apex in order [closed]

My requirement is to pass data from my org (Salesforce) to external org (SAP S4). I have successfully made the class for integrating both. However, I need to pass this class in a trigger and since it ...
Capt Shaunz's user avatar
1 vote
2 answers
283 views

Does heap size consumption accumulate across chained asynchronous threads?

For asynchronous transactions, such as queueable jobs, the heap size limit is 12mb. Let's say I chain 2 queueable threads together. If I pass records queried in the first thread to the constructor in ...
Kevin Antonioli's user avatar
-1 votes
1 answer
92 views

How to run a JS function residing in a VF page once a Queueable class executed from the controller class finishes its execution?

I have a command button in my VF page (ABC.page) - <apex:commandLink id="DownloadDOC" onclick="getAllDataForDoc('{!listOfObjects}')" title="Download Document" ...
Knight of the Vale's user avatar
3 votes
2 answers
837 views

What is the reason behind the runtime error when Queuable jobs in enqueued?

If a public class implements both Schedulable and Queueable interface public class A implements Schedulable, Queueable { public void execute(SchedulableContext c) { // } public ...
Patlatus's user avatar
  • 17.8k
1 vote
1 answer
345 views

Aborted job restarts

I have an enqueued job using system.enqueueJob( new APEX_Job_Queueable() ); This job is a long running job which makes callouts to retrieve date. The callout returns a NextLink Url which, when ...
fredbe's user avatar
  • 135
0 votes
1 answer
186 views

I am Trying to chain queuable class and write test class but i am getting error System.AsyncException Maximum stack depth has been reached

error which i am facing System.AsyncException: Maximum stack depth has been reached public class AccountQueable implements Queueable{ public void execute(QueueableContext qc){ Account ...
mahesh babu's user avatar
0 votes
1 answer
553 views

Why is queueable not picking updated state?

Queueable class allows non primitive data type but they are also not picking updated state of object rather state that was passes to it when job was enqueued. Below is my snippet of code which I was ...
Elijah's user avatar
  • 859
0 votes
0 answers
2k views

Queueable Apex Job: INVALID_CROSS_REFERENCE_KEY, Owner ID: owner cannot be blank: [OwnerId]

I keep getting an error on this line when trying to update the lead list. "INVALID_CROSS_REFERENCE_KEY, Owner ID: owner cannot be blank: [OwnerId]" leadsToUpdate.add(new Lead(OwnerId = l....
happylittletrees's user avatar
0 votes
2 answers
248 views

Getting Current AsyncApexJob at Runtime

I'm trying to get the current AsyncApexJob. Using Request.getCurrent().getRequestId() and Request.getCurrent().getQuiddity() gets me that it is a Queueable that is running, but I'm looking for the ...
aaron's user avatar
  • 864
0 votes
0 answers
166 views

Does it ever make sense to use Queueable to enqueue a Batch Apex class?

A simple question. Does it ever make sense to use Queueable to enqueue a Batch Apex job? If I enqueue a Queueable job that executes a Batch Apex job, is it the same as if I executed a batch job from ...
DevelBase2's user avatar
0 votes
1 answer
4k views

Can I enqueue a Queueable from inside of the Queueable class itself?

I'm working on some code that needs to make callouts async (because it's run as part of a trigger) and am using Queueable. In my situation, there are some scenarios where the records are already in ...
Derek F's user avatar
  • 64k
0 votes
1 answer
287 views

Loosely coupled Queueable framework

Edit: Sorry for the confusion! I’m trying to use this generic framework I mentioned below the error message I’m getting from my code which is calling a standard queueable class. So, my question: I ...
Nick's user avatar
  • 7,153
-1 votes
1 answer
2k views

QUEUEABLE TEST CLASS

I have a request to create a queueable test class where the test class is to use @testsetup using a testdatafactory returning a complex wrapper class. The idea is the testDataFactor should populate ...
Daryn's user avatar
  • 251
0 votes
1 answer
339 views

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out Even I am Doing DML after callout

Description I am getting huge 30 mb csv data in chunks via api from aws and passing these chunks in Queueable Class that is called from same api class. Queueable Class is further calling batch apex ...
rose's user avatar
  • 1
1 vote
1 answer
331 views

Apex: I'm shoving all the DML into a queued job, but still get "Uncommited work pending"

So, I've heard that you cannot do any Callouts after a DML operation in Apex. So, I've designed my app this way (some pseudo-code follows): String url; List<Object> chunk; for (Integer page=1; ...
pilat's user avatar
  • 113
0 votes
1 answer
3k views

Future methods in flow actions

I've two flow actions which both make HTTP callouts. The second action depends on the output of the first. However, since future methods don't return a value, I'm unable to use the second action in ...
vishesh's user avatar
  • 763