Questions tagged [queueable-apex]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
33 views

Is it possible to create a more than 100000 records at once for some salesforce object using apex code from developer console? [duplicate]

I am trying to write an apex code that will test the limitations of a production org while trying to create about 100000 account records at once. Can you please provide apex code samples. Many Thanks
-3
votes
1answer
45 views

Salesforce limit for concurrent calls of Async Apex

What is the limit of max concurrent calls for Batchable apex Queueable apex Future methods Need the Limit for both the scenarios 1. Limit for running the same batch (with different transactions), 2. ...
1
vote
0answers
31 views

Resubmit API Callout from Queueable method

I am working on an assignment where I need to process some subscribed events in Salesforce when a third party system publishes an event. The third party system publishes an event when there is a ...
0
votes
2answers
44 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. ...
0
votes
0answers
37 views

Phantom Runaway Queuable Job "Limit Check"

I have some very strange sandbox behavior - there is a runaway queuable job that appears to be doing absolutely nothing in the system, last only .006 seconds, and completely locks up the system as it ...
0
votes
1answer
28 views

Queueable insert list records from map and keep order

I have Map with Account and Account Id. I want to insert that accounts in Queueable and return list of all ids in order as acount is inserted(Or map, it doesnt really matther). How can i keep order if ...
4
votes
2answers
359 views

How to avoid System.AsyncException: Maximum stack depth has been reached [duplicate]

I need to consume an API from an external source and insert it in my Enterprise org. I have to retrieve 200 at most in every transaction. I implemented a Queueable Apex class that chains itself in the ...
0
votes
1answer
43 views

Why Queueable came into the picture [duplicate]

Why Queueable came into the picture when we already had Batch Apex available to Us. I know Queueable is better than future in context of accepting non-primitive data types and for job monitoring and ...
0
votes
1answer
45 views

How to use Wrapper Class in constructor and call it in Queueable?

My Queueable Apex class worked fine before but after discovering Apex PMD ruleset, found that using >4 parameters in any method or constructor is not best practice. I tried searching up answers ...
0
votes
1answer
226 views

Chain from Queueable

Is it possible to make a chain of execution with Queueable? My task after running the first Queueable is to get a token (callout) and only when it is available (in Custom MetaData) to run the next ...
3
votes
1answer
33 views

Queueable sits in "Processing" state then throws GACK: Salesforce System Error: Exception serializing: myNs.MyQueueableClass

I've got a class with a finalizer, more or less like this: public with sharing class queueableRepro implements Queueable, Finalizer { Set<Id> someIds = new Set<Id>(); SomeClass ...
0
votes
1answer
30 views

How would I resolve a 429 error that does multiple api callouts from a scheduled class that calls multiple instances of a Queueable class

I have a scheduled class that calls a Queueable class which does an api callout. What seems to be happening is once the scheduled class is done setting up all of the queueable classes to run, they all ...
5
votes
2answers
648 views

Infinite queueable chaining, what is the drawback?

As mentioned here Because no limit is enforced on the depth of chained jobs, you can chain one job to another. You can repeat this process with each new child job to link it to a new child job. What ...
5
votes
2answers
294 views

How can I share state between 'Queueable' executions?

I am developing a Queueable class to send data to an external system via HTTP callouts. I am planning to chain this class to call itself multiple times, until all records have been processed, or until ...
-1
votes
1answer
43 views

How to store the Job id in static variable in two different executions [closed]

I am having the trigger code in account object in both delete and insert context variable.I want to change the operations in queuable in trigger handler. If(Trigger.isafter && Trigger.isInsert)...
0
votes
1answer
124 views

Where does Queueable job gets Queued?

I wrote this class: public with sharing class QueueTest1 implements Queueable, Finalizer{ public QueueTest1(){ } public void execute(FinalizerContext param1) { System.debug('...
0
votes
1answer
170 views

Using Finalizers to Work Around Too many queueable jobs added to the queue: 2?

I was testing Finalizer interface with Queueable apex and I think it can also be used to overcome this error: System.LimitException: Too many queueable jobs added to the queue: 2 I created a class ...
1
vote
2answers
65 views

Q&A: Are there problems using System.abortJob() in Test Methods to Avoid Depth Max Governor Limit

Been posting here a bit around the ideas of Queueable Chains and test Methods. All of you have been very helpful. I had one last piece I ran into during deployment that I had to fix. The code snippet ...
0
votes
1answer
53 views

Get Full Coverage on Queable Chain of API Calls

Problem I have process that is a Queueable Chain that calls 9 different Queueable Classes (below is 2/9 but all follow this pattern). Of these, 8 are making API callouts to another Salesforce Org. ...
0
votes
0answers
45 views

Testing queueable method which relies on jobId

I've updated my code to do some logic along these lines if no job has been created, create a job using System.enqueueJob(QC) and store it's job id. take a bunch of data and store it in a custom ...
3
votes
3answers
300 views

Chain Methods with Class that Implements Queable

Update Attempt to Chain in Helper Class -- Not Working -- Separate Class Still Works. My last update was premature. This doWork method still does not control the order of the calls once they are ...
1
vote
1answer
100 views

Queueable Apex User Context in Unit Tests with System.runAs block not the same as productive code

I noticed that the running User Context of a Queueable Job in a unit test depends on who calls the Test.stopTest() method. Or rather when is the job to be executed in the unit test context. I wonder ...
0
votes
1answer
191 views

Too many queueable jobs added to the queue: 2 Testing Help Needed!

I have a problem on my hands around getting enough code coverage for the below code I am working on. The Scenario: When a CPQ quote is being worked and it is a primary quote I have a process builder ...
0
votes
0answers
54 views

You have uncommitted work pending. Please commit or rollback before calling out in Queueable apex

I am getting the following error You have uncommitted work pending. Please commit or rollback before calling out while executing the below code global class AmendContract_Queueable implements ...
-1
votes
1answer
65 views

How to avoid Too many queueable jobs added to the queue: 2

I am trying to run a test class which is inserted and updating the same account. I do have a queaueable class calling from onAfterInsert and onAfterUpdate. Do I have a quick fix for it? public void ...
0
votes
0answers
62 views

Why I am not able to update the fields in account after queable class is executed

I have a scenario where I need a better approach. I am trying the Queueable class for the first time. I have an AcccountTriggerhandler on which I am calling the Queueable class on onAfterUpdate. Once ...
0
votes
2answers
196 views

Batch job chunks calling queueable jobs transaction limit

This is a basic question instead of code related. I am writing a batch job which will update Application__c records. Trigger for Application__c object, enqueues a queueable job to update cases Batch ...
0
votes
0answers
97 views

Will a Queueable Class run in series if it is recursive?

I have a scenario where I need to call an API from a trigger that will update a few fields from the API. The trigger is an after insert and is setup to avoid recursion with other triggers on the same ...
0
votes
0answers
41 views

Passing two different attributes into single Queuable class

I am passing the input from trigger to Queuable class. My trigger code In after insert: system.enqueueJob(contactTriggerHandler.test(trigger.new,null)) In after update: system.enqueuejob(...
0
votes
1answer
60 views

Queuable apex basics

I have a method in apex class public static void test(List<contact> newOppProdList,Map<Id,contact> oldOppProdList){ List<test__c> testprod= [Select Id,name from test__c];...
0
votes
1answer
51 views

Is there a way to add data to an enqueued job?

I have a situation where my managed package has triggers that kick off an asynchronous method. I'm running into an issue where if an aync. Process fires my trigger twice causing me to hit a governor ...
2
votes
1answer
132 views

How to monitor not yet started jobs of a Queuable chain

I am wrapping my head around how to use Apex Queuable as a queue and not as a chain. As I understand all the code samples out there, the next job is enqueued after the work of the previous one is done....
2
votes
1answer
56 views

Why does adding a Queueable cause an INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY error?

I have code that inserts a ContentVersion (a File) that is run under a "Customer Community Login" license inside a Community/Experience. That works fine. I now have an optional asynchronous ...
0
votes
0answers
63 views

Executing a callout at the end of a chain of methods operating in @future context

I have a callout method that is executed as the last step of a long chain of methods when a record's status get changed to "completed". Early in this sequence, we have a method that we have ...
1
vote
0answers
31 views

Enqueuing chained queueable instances that trigger deployment jobs don't perform deployment

I've got problem with executing deployment jobs inside queueable instance. Background: Exchange rates data is divided between two endpoints a and b. That's why I need to make a callout twice. ...
0
votes
2answers
245 views

How to replace _id with id in a JSON response using REST API?

I am making a GET callout to the URL: https://th-superbadge-apex.herokuapp.com/equipment?_ga=2.245262661.1986105727.1612691455-984520333.1610882684. In the URL, the id field starts with _id which I ...
3
votes
1answer
331 views

Can Database.executeBatch be called from a Queueable started by System.enqueueJob?

I'm aware that you can't call Database.executeBatch from the execute method of an already running Batchable. But can Database.executeBatch be called from a Queueable running via System.enqueueJob? I'm ...
0
votes
1answer
222 views

Return from a future/Queueable callout

I have to do a callout, but before doing the callout I need to update the cases and use the values from the cases' fields in the request body and then do the callout. I cannot do DML before callout. ...
0
votes
1answer
225 views

What user is queueable apex class running as?

I have a queueable class, that is executed correctly (and working asynchronosly calling external services) I have an issue, that within the class, the following line: system.UserInfo.getUserEmail() ...
4
votes
0answers
425 views

What is Causing INVALID_TYPE_ON_FIELD_IN_RECORD Error in Queueable Class?

Goal My goal is to create a reusable Apex action/invokable method to allow a flow to asynchronously insert/update/delete a collection of records using the queueable interface. Note that I am aware of ...
0
votes
1answer
228 views

can queueable method set a trigger handler static variable

Title of the question is mis-leading. Since yes, a queueable method can access a static variable of a class. But i have an existing old implementation, and i am trying to refactor and clean it up. ...
1
vote
2answers
136 views

How to remove SOQL Query from the for loop by Queueable in apex

I need to retrieve the field value given subject. But the only way I find to do it is by doing a dynamic query in a For or loop. Did anyone have a solution to avoid the query in the loop? Or any other ...
0
votes
1answer
638 views

calling a queueable from a trigger and avoiding overfilling the flex queue

So I'm refactoring some code for my company, we have some triggers that all call a common method. I'm going to refactor that class to be queueable. My first implementation of it was to just change the ...
2
votes
1answer
57 views

Prevent limits in a callout intensive process where client can only receive one request at a time?

I have a callout intensive process where the client can only receive one request at a time and I'm having a hard time identifying what is the best practice for asynchronous solutions to handle this ...
0
votes
1answer
217 views

Handling a combination of async callouts, schedulable jobs, and queueable jobs

The current requirements for my system is as follows: When a certain change is saved on the Account object, I need to create an Order object and make a callout to Service A. Service A finishes ...
4
votes
0answers
446 views

AsyncApexExecutions Limit exceeded different errors

We have a batch that is running queueable inside batch execute. And we are testing this framework with volume data to know its limits. To give an example, if I test it using 1000 records with 1 scope ...
3
votes
7answers
3k views

Implementing test class for Queueable Apex that makes call outs

I have a Queueable class MyQueueableClass which in turns calls an outbound web service class. public void execute(QueueableContext qc){ try{ GlobalCallout.makeCallout(caseId); } catch (...
0
votes
1answer
847 views

Future Callouts and Queueable from a Trigger

I am pretty new to salesforce development. I am trying to make a Callout to the third party API whenever a Account record is created in Salesforce. I tried to make the future callout and didnt realize ...
0
votes
0answers
136 views

Queueable class Too many SOQL queries: 201

I need to create a HTTPPost method to generate a report so when I did it at first, I had exceeded the number of queries limit so I implemented a queuable class to solve the issue as I have read in the ...
0
votes
2answers
1k views

Batch Apex vs Queueable

Thanks to another user (sfdcfox) I've got the following queueable apex being invoked via a screen flow that's being used to update account records. It's taking two string variables from the flow and ...