Questions tagged [queueable-interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
108 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 --...
  • 145
-1 votes
1 answer
33 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" ...
2 votes
1 answer
65 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 ...
  • 14.7k
7 votes
1 answer
1k 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 ...
2 votes
2 answers
2k 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. ...
  • 431
0 votes
1 answer
183 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 ...
  • 1,959
3 votes
1 answer
2k 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 ...
  • 888
0 votes
1 answer
2k 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....
1 vote
1 answer
2k 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 - ...
2 votes
1 answer
413 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 ...
  • 3,024
0 votes
1 answer
235 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 ...
  • 1,556
9 votes
3 answers
3k 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 ...
  • 501
1 vote
1 answer
665 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 ...
2 votes
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 ...
  • 3,024
2 votes
3 answers
2k 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 ...
  • 555
3 votes
1 answer
533 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 ...
  • 4,997
5 votes
1 answer
3k 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 ...
  • 321
1 vote
1 answer
516 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 ...
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 ...
0 votes
1 answer
128 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 ...
  • 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 ...
10 votes
2 answers
9k 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 ...
0 votes
0 answers
191 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 ...
  • 1,556
0 votes
1 answer
350 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 ...
0 votes
1 answer
242 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 ...
  • 75
6 votes
2 answers
916 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 (...
  • 251
0 votes
2 answers
705 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 ...
  • 11
2 votes
0 answers
299 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 ...
  • 4,355
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 ...
  • 4,681
0 votes
1 answer
692 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/...
  • 4,681
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 ...
  • 2,563
4 votes
1 answer
983 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 ...
  • 2,520
3 votes
1 answer
452 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 ...
2 votes
1 answer
7k 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....
  • 1,043
1 vote
1 answer
259 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 ...
  • 6,747
8 votes
1 answer
706 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 ...
  • 760
5 votes
0 answers
753 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 ...
  • 10.8k
29 votes
1 answer
19k 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 ...
  • 4,997
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 ...
1 vote
1 answer
256 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 ...
  • 1,106
1 vote
1 answer
614 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 ...
  • 9,787
16 votes
2 answers
5k 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?...
  • 760
19 votes
1 answer
5k 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 ...
  • 25.1k
5 votes
1 answer
975 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 ...
1 vote
1 answer
99 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 ...
  • 1,285
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 ...
4 votes
3 answers
3k 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 ...
  • 828
1 vote
1 answer
1k 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 ...
1 vote
1 answer
608 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 ...
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....
  • 5,768