Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [queueable-interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
1 answer
203 views

Point to Point integration vs middleware

I'm a newbie in integrations and I've been recently thinking about when to use Point to Point and middleware integrations. My goal is to somehow understand how to decide which one is the best when ...
user avatar
0 votes
2 answers
78 views

Queuable Apex callout

Requirement is to loop through set of records(could be in 1000's) and make a REST callout to process those records. I did went through multiple Q&A posted in the community but still stuck with it. ...
user avatar
  • 389
0 votes
1 answer
128 views

Do queuables break inserts up to avoid 101 SOQL Limits?

I have a case comment trigger that queries data based on the trigger.new using IN. Ex: SELECT Id,Type FROM Case WHERE Id IN:caseIds where caseIds is a list of parentIds of the CaseComments being ...
user avatar
  • 1,818
2 votes
1 answer
1k views

How's This for a Simple HTTP Callout Retry Framework?

Most of what I have read about retry operations is that they are vaguely complicated and indepth. I have written the code below which seems to accomplish this without too much confusion - I'm ...
user avatar
  • 628
0 votes
1 answer
989 views

too many queueable jobs added to the queue error - make 2nd callout upon receiving response from first callout [duplicate]

i have a triggerHandler class in which on after update i am sending list of records of Account object to queueable class public override void onAfterUpdate() { If( Limits....
user avatar
  • 1,516
1 vote
1 answer
992 views

pass list of sObject from one queueable job to another

I am trying to pass Sobject from trigger to a queueable and then i am calling another queueable and trying to pass the same sObject. But i am unable to get the values in queueable . Trigger - ...
user avatar
  • 1,516
2 votes
1 answer
297 views

Batch->Queueable->Callout+DML ::: Uncommited work pending issue

I am having following structure, where I am getting issue- CalloutException: Uncommited work pending. Ideally, with Queueable it should not throw the same error(since DML is happening at last in ...
user avatar
  • 2,761
0 votes
1 answer
122 views

CPU limit queueable job

I have a scenario where I'm inserting large number of records through trigger --> queueable job and running in to CPU timeout exception. I believe the best way of overcoming this is to split records ...
user avatar
  • 1,496
8 votes
3 answers
2k views

Queuable Apex logic in Constructor or Execute Method

I have a chained queuable apex class making an HTTP request to an external server. After each request comes back with a successful response, the next class will fire and make another request to a ...
user avatar
  • 481
1 vote
1 answer
480 views

Using Queueable Apex to avoid limit of 100 jobs in the flex queue

I am receiving the following error for some of my batches every here and there: You've exceeded the limit of 100 jobs in the flex queue for org 00D6A000000vKLe. Wait for some of your batch jobs to ...
user avatar
1 vote
2 answers
1k views

Why we are allowed to pass sObject in queueable?

I am having a small doubt, and want to have some inputs on that. For future methods, we are not allowed to have sObjects as method params/arguments. and the reason in documentation is stated as ...
user avatar
  • 2,761
2 votes
3 answers
1k views

Does queueable interface/class use Flex queues

I have tried to find its answer on multiple places but unable to do so, I know Batch classes use Flex queues and Batch queues. Just wondering what does queueable interface or class use? Does it also ...
user avatar
  • 555
3 votes
1 answer
410 views

Change Data Capture vs Queueable Apex

With the introduction of Change Data Capture, now there is one more way to execute Asynchronous Apex. What are the advantages of Change Data Capture over Queueable Apex? How Salesforce will enqueue ...
user avatar
  • 4,917
5 votes
1 answer
2k views

Enqueue Queueable class multiple times

I need to do five different callouts from my trigger. I'm planning to use one Queueable class for all the callout using the parameter passed in the constructor. I'm not sure if it is possible, if it ...
user avatar
  • 321
1 vote
1 answer
397 views

Uncommited work exception in Queuable with Callback and Rollback

Is there a way to do all that Do Callout in Queueable Do Dml based on the Callout result Catch errors in 1 and 2. Rollback 1, 2 on error Report error via email and log in Custom object without ...
user avatar
4 votes
2 answers
1k views

Send out email when Apex Queueable fails and test it

This question definitely is a duplicate of many questions here, but after reading most of them I am still somewhat clueless. Question 1: why I can't just catch exceptions in the execute and send an ...
user avatar
0 votes
1 answer
89 views

In Visualforce how to display progress and errors of Asynchronously upserting the results of 999 queries? [closed]

In Visualforce I need to ASYNChronously do 999 (n) multi-table queries and upsert all results (asynchronously, and presumably in chunks), to 1 custom_object__c, all from a visualforce page. The page ...
user avatar
  • 1,080
5 votes
2 answers
1k views

Automated testing of chained Queueable jobs in Salesforce

I am currently writing a queueable class for asynchronous processing in my triggers since triggers do not allow callouts. I am going achieve it by calling a class which implements the queueable ...
user avatar
9 votes
2 answers
6k views

When passing in a collection of sObjects to a Queueable what values are used?

Suppose I pass in a collection of sObjects to a queueable. Does the queueable execute on the values of the sobjects field that get passed when the queueable is invoked? Given it is possible for these ...
user avatar
0 votes
0 answers
166 views

Queueable method is not returning the updated values in test class

I have a trigger which passes the list of objects to a queueable method, the queueable method performs the DML on the related parent/child objects. In my test class when I insert a record, the ...
user avatar
  • 1,496
0 votes
1 answer
289 views

How to know the completed time stamp of my scheduled Queueable class

I'm looking at What's the difference between AsyncApexJob and CronTrigger? Currently I have a Schedule class, and queueable class(which fires future methods). Below is the hierarchy: Schedule class ...
user avatar
0 votes
1 answer
187 views

Set Status Detail on Apex Jobs page

When using the Queueable interface, is there a way to set the Status Detail on the Apex Jobs page? Seems like that field is only for catching the errors, but it would be nice to be able to insert ...
user avatar
  • 45
6 votes
2 answers
769 views

Queueable Apex consideratoins

This is more of a theoretical question and probably goes more to design and I hope I can do this justice. I have successfully coded in apex multiple triggers which make callouts using the @future (...
user avatar
  • 251
0 votes
2 answers
559 views

SOQL Query on PricebookEntry returning no rows

I'm trying to create a queueable apex class which will update the unit prices of all Products (on all Pricebooks) based on newly updated exchange rates. I'm able to successfully query on ...
user avatar
  • 11
2 votes
0 answers
279 views

Post callout behavior assertions for unit test with static resource callout mock fail

I have a working queueable callout, and working tests using static resource callout mock I can successfuly run basic assertions on the mock response body and status. However, the callout method in ...
user avatar
  • 4,203
2 votes
0 answers
3k views

ApexMock - Test method to invoke a Queueable method fails

I am using ApexMocks to write unit tests for a method that invokes a Queueable class. My test objective is to verify is the class has been invoked once via the trigger handler. Below is a sample code ...
user avatar
  • 4,521
0 votes
1 answer
575 views

Using ApexMocks for a class that implements Queueable Interface

I am trying to write a unit test for a trigger handler method that enqueues a queueable class. I am using ApexMocks to write the unit test for this trigger method. https://github.com/financialforcedev/...
user avatar
  • 4,521
2 votes
1 answer
2k views

Calling Async from Async Process

Future and queueable are both async process as per the documentation, And async can't be called from the async process. Then why when we try to reference a future method inside a Queueable class, it ...
user avatar
  • 2,493
4 votes
1 answer
781 views

Difference between using System.Queueable and Queueable and where to use Database.AllowsCallouts

I was trying out the superbadge of Data Integration specialist and implemented the inner class QueueablePMSCall as expected. The class was declared as: private class QueueablePMSCall implements ...
user avatar
  • 2,450
3 votes
1 answer
429 views

Is there a way to chain jobs indefinitely?

What I mean is that I want a way of running some kind of loop indefinitely. This loop is going to make a callout to an endpoint, and it needs to be fast (so it can't be scheduled to run 10 to 10 ...
user avatar
2 votes
1 answer
6k views

Using Batch and Queueable causing Too many queueable jobs added to the queue: 2

I'm going to try and provide a blueprint of the code that I have in my production org. Batch global class EventBatchJob implements Database.Batchable<Event>, Database.Stateful, Database....
user avatar
  • 948
1 vote
1 answer
238 views

Mixed DML conflict in unit test involving two queueable jobs

I have a complex Apex trigger that calls two separate queueable jobs - one job inserts Permission Set Assignments, and another job creates and deletes ContactShare records. I am positive that neither ...
user avatar
  • 6,330
7 votes
2 answers
600 views

Throttling http callouts across queueables executed in parallel

I have a batch job which processes millions of records through an HTTP callout to a third-party API. The API doesn’t handle batching, so each record needs its own callout. It takes well over 24 hours ...
user avatar
  • 738
5 votes
0 answers
613 views

Execute some code after all trigger batches complete?

Suppose I update 1000 records and I have an after update trigger. That trigger will run 5 times for each batch of 200. Is there any possible way to collect data over the course of the 5 executions and ...
user avatar
  • 10.6k
27 votes
1 answer
15k views

System.AsyncException: Maximum stack depth has been reached

I have two Queueable classes, I am trying to execute them by chaining them. First approach was to calling second queueable from first class. But, it gives me System.AsyncException: Maximum stack depth ...
user avatar
  • 4,917
8 votes
2 answers
2k views

How to set an HttpCalloutMock to reply differently on subsequent requests to the same endpoint?

I'm building a Queueable that consumes an Azure service bus queue. Every call to the endpoint gives me one message so I keep on calling that same endpoint until I get a 204. The method that calls the ...
user avatar
1 vote
1 answer
250 views

Callout and chain Queueable - Spring 17

In Spring 17, I saw in the release notes (https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_apex_chaining.htm?edition=&impact=) that we can now chain Queueable Jobs that ...
user avatar
  • 1,076
1 vote
1 answer
551 views

Queueable not restoring state for execute() in unit test

I have a Queueable implementation that is working fine, but fails when I try to test it. It seems that when unit testing the state is not properly being restored during the execute method. Test ...
user avatar
  • 9,446
15 votes
2 answers
4k views

Governor Limits on System.enqueueJob in Asynchronous Apex – Documentation Wrong?

Is there any execution context which uses asynchronous governor limits and allows up to 50 jobs to be queued with System.enqueueJob in a single transaction, or is Salesforce’s documentation just wrong?...
user avatar
  • 738
19 votes
1 answer
4k views

Can Queueable Apex Jobs Run in Parallel?

I've got a queueable Apex class that can create parent records for sources records passed into it. It maintains a map as it goes so that if two source records should relate to the same parent and it ...
user avatar
  • 24.7k
5 votes
1 answer
768 views

Design pattern for logging HTTP Callouts

I'm building an application that integrates with an external service. Two items on our list of requirements is: Log all Callouts to the external system in Salesforce Execute all Callouts in a ...
user avatar
1 vote
1 answer
98 views

Asynchronous calls behaviours

I would like some help over below: I have an use case where due to Apex CPU timout limits i would like to make this trigger in asynchronous with other objects. I was wondering Since sales force has ...
user avatar
  • 1,277
2 votes
1 answer
1k views

I want to pass an HttpRequest object to a Class that implements the Queueable interface

This is similar to this question, but I'm wondering about the object I'm sending into the Queueable Class. Here's the Queuable Class (not much more than debug statements at this point) public class ...
user avatar
4 votes
3 answers
2k views

How to set time limit between queued jobs?

So I am looking to implement Queueable jobs in apex to send 200 emails (1 job) every 30 minutes until all the jobs are done, I am struggling to find any documentation on how this functionality can be ...
user avatar
  • 822
1 vote
1 answer
908 views

Can a future method conflict with a queuable method?

My custom code is executed using a queuable class. Sometime it runs perfectly, other times it gives this error: Failed to update list. Error: System.DmlException: Update failed. First exception ...
user avatar
1 vote
1 answer
491 views

How to make callout to tooling api from the queueable apex which is enqueued in scheduler where source and target orgs are same? [duplicate]

I am calling tooling api from my Queueable apex to get information of flow object from my org and scheduling it on daily basis. Now my problem is when I run my code from anonymous window with ...
user avatar
1 vote
1 answer
3k views

Why Unauthorized Endpoint error coming even after adding Remote Endpoints?

Here is the error I'm getting when I try to call a Tooling API Rest Api: 00:53:19.0 (7411847)|CALLOUT_REQUEST|[28]|System.HttpRequest[Endpoint=https://vcorg-dev-ed.my.salesforce.com/services/data/v36....
user avatar
  • 5,596
3 votes
1 answer
1k views

System.AsyncException: System.enqueueJob is not allowed in this context

I'm trying to call Queuable interface class from controller class and getting an Exception. Why? System.AsyncException: System.enqueueJob is not allowed in this context.
user avatar
0 votes
1 answer
114 views

Filling custom field with Queueable Class

I'm new to Apex Developing and I'm facing pretty strange issue with my code. I've recently write queueable class to check custom checkbox on Case Alert_view__c. The idea is that checkbox will be set ...
user avatar
  • 171
2 votes
1 answer
3k views

Limit of Queueable Jobs Added to the Queue?

I have chained three queueable classes. Couple of them have callouts and other one is not callout. For both the callout classes execute method execution, "No of queueable jobs added to the queue&...
user avatar