Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [queueable-interface]

The tag has no usage guidance.

0
votes
1answer
42 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
160 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 ...
3
votes
2answers
299 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
23 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
47 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
35 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
88 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
71 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
78 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
891 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
184 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
518 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
244 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 ...
3
votes
1answer
113 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
671 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
74 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
191 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
315 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 ...
8
votes
1answer
3k 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 ...
5
votes
2answers
355 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
155 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
105 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
839 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?...
11
votes
1answer
1k 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
235 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
68 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 ...
3
votes
1answer
560 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
801 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
318 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
260 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....
2
votes
1answer
591 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
50 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
56 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
393 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
428 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
260 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
677 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
74 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 ...
4
votes
1answer
176 views

Keep track of chained Queueable

I'd like to insert a lot of records. Chaining Queueable classes seems to be the way to go in my scenario, I am just wondering if the following is feasible: keep track of chained jobs - when first job ...
2
votes
0answers
532 views

ConcurrentPerOrgApex Limit exceeded

We are calling Queueable Interface from trigger to make multiple callouts to external systems. The number of callout from Queueable class is 50 as the other system can process only one record at a ...
2
votes
1answer
235 views

Delay in Queueable job execution

I have a Queueable job en queued by a custom trigger and the Queueable job makes REST API call to an external system. When I monitor the job, it used to start processing in couple of minutes but in ...
1
vote
2answers
425 views

Execute method not getting invoked in Queueable

I wrote my first Queueable class public class ExpensePDF_Async_Helper implements Queueable, Database.AllowsCallouts{ private List<Expense_report__c> PDFsTocreate; ...
5
votes
1answer
77 views

Queueable logs don't have a completed date?

Working on writing a queueable and noticed that the completed date field under Apex Jobs is blank. Futures have this. Is the only way I can get a run time is to log it myself?
2
votes
2answers
3k views

Why salesforce has introduced Queueable Apex. need some proper clarification

future method behaviour - 1. is executed in their own thread 2. do not start untill resource are available 3. future callout gives us 200 asynchronous soql limit. Why we use Queueable Apex and in ...
9
votes
1answer
459 views

Implement Domain Event Pattern in Apex - can and should it be done?

In Domain Driven Design a single pattern is drawing a lot of attention to itself - Domain Events and Event Queues. (slide via http://de.slideshare.net/andysal/never-mind-the-bollocks-heres-the-domain-...
6
votes
1answer
104 views

A callout pattern idea

I just came up with the following pattern for making callouts. It's loosely based on Dan Appleman's Scheduler pattern. Has anyone out there has used or dismissed this? Why did you dismiss it? ...