Questions tagged [queueable-interface]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
40 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 ...
1
vote
2answers
26 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 ...
-1
votes
0answers
6 views

Need help to cover Queueable apex test class [duplicate]

public class QuotexLineCloned implements Queueable, Database.AllowsCallouts { public final String newlineid; public QuotexLineCloned(String newlineid){ this.newlineid = newlineid; }...
1
vote
2answers
74 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 ...
3
votes
1answer
61 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
votes
1answer
303 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 ...
1
vote
1answer
72 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
2answers
277 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
1answer
55 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 ...
5
votes
2answers
373 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 ...
4
votes
2answers
532 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
0answers
27 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 ...
0
votes
1answer
87 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
1answer
72 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 ...
2
votes
2answers
265 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 (...
-1
votes
2answers
147 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 ...
2
votes
0answers
143 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 ...
1
vote
0answers
2k 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 ...
0
votes
1answer
257 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/...
1
vote
1answer
969 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
votes
1answer
379 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
votes
1answer
198 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 ...
1
vote
1answer
2k 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
vote
1answer
110 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 ...
7
votes
2answers
303 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 ...
4
votes
0answers
398 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 ...
15
votes
1answer
5k 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 ...
8
votes
2answers
780 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
1answer
182 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
vote
1answer
203 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 ...
11
votes
1answer
1k 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?...
13
votes
1answer
2k 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 ...
4
votes
1answer
345 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
1answer
81 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 ...
2
votes
1answer
699 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
3answers
1k 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 ...
1
vote
1answer
469 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
1answer
286 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
1answer
2k 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....
3
votes
1answer
787 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.
0
votes
1answer
62 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 ...
1
vote
1answer
2k 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" is ...
0
votes
2answers
60 views

Error in Bulk Pattern SOQL

I am getting an error in the for loop. Error: Variable does not exist: acclist public class AddPrimaryContact implements Queueable { Private Contact conl = new Contact(); Private String sty; ...
7
votes
2answers
2k views

System.AsyncException: Maximum callout depth has been reached

I have a System.Queuable job, on a particular Sandbox that is giving me issues. It works fine on other Orgs, but fails on this particular one. The job structure is this: Batch Apex job calls System....
5
votes
1answer
580 views

Queueable class throws Uncommitted Work Pending error in one test, but not others [duplicate]

I noticed yesterday that one of my new test cases was failing, and determined from the logs that I was getting the beloved System.CalloutException: You have uncommitted work pending. Please commit or ...
7
votes
1answer
538 views

Chaining Callouts and Queueables

I have the following pseudo-code, and what I am attempting to do is chain queues that require call outs, I have read around and saw that you can't create another queue after a call out. I see the ...
5
votes
1answer
270 views

How can I get around queued job limitations?

I'm writing a queueable class to perform some image optimizations. The class has to call out to AWS S3, get the source image, then call out to Kraken.io three times to optimize the source image, get a ...
7
votes
1answer
814 views

Test execution order issues with Queueable and @future method

Test code: * Test.startTest(); * System.enqueueJob(new MyJob()); * Test.stopTest(); * System.debug('Quering record for assertion'); Expected Queueable job execution: * Job Start * Query records * ...
0
votes
1answer
33 views

queuable interface issue

I have two separate classes for making callouts(class One & class Two) and I am calling both of these classes in another seperate class.wherein I would like to send the filter callouts first ...
0
votes
2answers
77 views

Queuable interface calls many times

I'm calling a queuable interface via a trigger afterupdate. this queuable interface is allowing callouts to an external webservice ( Database.AllowsCallouts ). When I check the apex jobs, I found ...