Questions tagged [queueable-apex]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
30 views

Queueable apex invoked from triggers doesn't inherit sharing correctly

Consider the following class: public inherited sharing class testQueueableSharing implements Queueable { public void execute(QueueableContext context) { update [SELECT Id FROM User WHERE ...
0
votes
1answer
30 views

FATAL_ERROR System.LimitException: Too many DML statements: 151 is encountered when the test class is ran. Why?

Queueable class code is down below: public class AddPrimaryContact implements Queueable{ private Contact contacts; private String state; public AddPrimaryContact(Contact records, ...
0
votes
0answers
15 views

Queue members can not edit case record through Apex even though submitted record for approval is unlocked

I have two objects Contract and Case and if any cost update happens to contract through visualforce/lightning page, case trigger handler is fired to update also. Here are the recent changes done in ...
0
votes
2answers
48 views

How to capture Queueable class status when job is completed

I have created Queueable class to process data and making the callouts this Queueable class executes upon after update and after insert of Opportunity object. Now in order to track the status of ...
0
votes
1answer
19 views

Is there an api to submit queueable job? [Api for System.enqueueJob]

Is there an api that allows to submit Queueable jobs? (basically which simulates System.enqueueJob) Searched Rest Api and other apis but couldn't find anything.
0
votes
1answer
31 views

Platform Events - Fire platform event from event trigger?

We are planning to build some kind of a processing chain, when every item in an array is processed in separate scope of limits. Processing should happen strictly in a sequential way, i.e. second item ...
0
votes
1answer
49 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....
3
votes
2answers
221 views

Queueable apex still executes in test context even if Enqueue Job is not called between Test.startTest() and Test.stopTest()

According to Salesforce docs: All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously. ...
0
votes
1answer
32 views

Queueable design patterns to avoid “Too many queueable jobs added”?

When my CustomObject1 is inserted or updated, I need to update a field on the Account object potentially traversing all the CustomObject1 who have a lookup-relationship to given accounts. In ...
0
votes
1answer
33 views

Are queuable jobs given precendence over batch jobs

I am trying to move my vf page controller logic to queueable job to over come cpu time out. I am monitoring the queueable job by polling the server from my vf page and then redirecting the user to a ...
0
votes
0answers
32 views

Treatment after a queuable Job is over

When my users click Validate, I enqueue a job and I have for this job to be over, to continue the treatment. I'm doing it in three steps : enqueue the job, and return its ID (1) this is where I'm ...
3
votes
1answer
136 views

Queueable apex and trigger execution context

If I enqueue an instance of a Queueable class during a before trigger, is it guaranteed that the Queueable class will not run until the after trigger completes?
1
vote
1answer
73 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 ...
0
votes
2answers
48 views

Trigger Recursion after API Callout to Run Territory Assignment Rules

I am trying to trigger territory assignment rules on accounts via the API (the only way you can, apparently), and then change the account owner based on the territories that are assigned. It’s an ...
0
votes
1answer
150 views

Creating Utility Classes - Batching sObject list

My goal is to create a reusable and scalable utility class that can perform different DML operations. I'm aware of the 10,000 DML processed records limit so I'd like to check if the list is greater ...
1
vote
1answer
48 views

Sending Inner class as a param from Queueable apex to a batch

I have a queueable apex that calls to a batch. Inside the queueable class - I have inner Class that writes a log with incorrect fields. The Inner Class inside the queueable class : public class ...
0
votes
1answer
50 views

Timeout Error: You have uncommitted work pending when Queueable is being called from trigger

I have a class with @future method: public without sharing class SubmitOnApproval { @future public static void oppRecordsToSubmit(id oppId){ Opportunity o = [select id, ...
0
votes
0answers
29 views

System.Debug() appears to be summing additional logged values

I'm running the following code, and I just want to log the total amount of deletes, and the total amount of records passed into the method and return the total amount of records that were processed ...
0
votes
1answer
45 views

update phone number field on Account obj off of phone number from Lead obj

I'm writing a Queueable Apex, that will run and compare search the Lead last name to the Account name if Lead lastname == Account name && Account phone field is null || blank then update the ...
5
votes
3answers
470 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 ...
1
vote
1answer
52 views

Queueable call not executing in case of partial success using Database.update

I have written logic that enqueues queueable class from trigger of one object. This works perfectly when I update records and all records gets updated successfully,but in case of partial success I can ...
0
votes
0answers
42 views

Multiple callouts dependant on each other in an InvocableMethod

I have an InvocableMethod apex function being called from Flow in which I make a total of 8 Web Callouts. They are all dependant on each other - so web callout 2 uses params returned by web callout 1 ...
1
vote
2answers
140 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 ...
0
votes
1answer
44 views

Queueable apex duration time issue

I'm running a Queueable that upsert contacts (in my example case it's just two contacts) and calling a batch with a Map < Id,String > - which Id is the Id of the upserted contacts, and the String ...
1
vote
2answers
33 views

Uncommitted work pending in unit test with queueable chain and httpcallout

I have a Schedule job that invokes a class and from there i call the Queueable class like this: ID jobID = System.enqueueJob(new NSQueuebleJob(acList)); The queueable class is: public class ...
3
votes
3answers
149 views

Apex more than 50 Queueble jobs

I have this class that call a Queueble job more than 50 times in a loop. I recive the error: Too many queueable jobs added to the queue. The limit is 50. Here is the class: global class ...
2
votes
1answer
310 views

How do SOQL queries act in Queueable (async) apex?

I have a set of 4 Queueable apex classes that perform an ordered series of tasks on a large number of records. It queries a limited number of records, modifies them so that they no longer meet the ...
1
vote
3answers
50 views

Future method completes first before the queueable

My scenario is: A future method is on a queueable class. Queueable job comes first before the Future job in the Apex Jobs. Upon checking the completion date(time), the future method is completing ...
0
votes
1answer
50 views

Why isn't my Queueable chain working?

I have the following class, none of the dependencies invoke Queueable: public class TEST_SandboxDataFactory { public static void create() { List<SObjectType> sObjectTypeList ...
1
vote
3answers
246 views

Why queuable apex accepts sobjects where as future methods doesn't?

I was going through asynchronous apex and reading it made me confused at one point. In future methods, we cannot pass sojects for reasons future methods being executed at a later point of time, by the ...
0
votes
0answers
10 views

How come my enqueued class is still getting executed in my unit test when I never call start/stopTest methods? [duplicate]

Per salesforce docs (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_tools_start_stop_test.htm): All asynchronous calls made after the startTest method are ...
4
votes
2answers
140 views

Spin locks with variable time retry backoffs

Use Case After insert triggers start Queueable Queueable execute() contends for same resource, uses spin lock to wait for resource availability. Many queueables could be running at same time. ...
1
vote
1answer
168 views

Conflicting triggers

I'm still new to Salesforce and still can't grasp regarding triggers. Scenario: My company's salesforce workspace has a managed package app installed. The managed package app has a custom trigger for ...
0
votes
1answer
266 views

Queueable Apex vs process builder and Flow

Here is the scenario: On insert of a record/records of Object - Apartment__c and conditions like Floor>7 AND Num_Of_Appt > 200(has like 4-5 conditions that should be met) , I should Query the ...
5
votes
2answers
105 views

How to disable asynchronous jobs so that they cannot update data

There will be a data export happening from our org for large number of objects and records using a cloud based ETL tool. We have a business scenario where we need to make sure that there is no data ...
1
vote
1answer
545 views

Queueable Apex in a Before Trigger

I am attempting to create logic that, on Contact record insert or update, will compare the Phone value of the record to another reference object and conditionally populate a checkbox as a result of ...
0
votes
1answer
544 views

Schedule a Queueable class

i am quite new to salesforce so i am not sure about this, and i wanted to get a clear answer since i haven't found one yet. Can i schedule a Queueable class that basically makes a callout to get and ...
2
votes
3answers
223 views

Overcome Queueable maximum depth limit in dev orgs

To migrate "trees of related data" from an external system to Salesforce I am using dynamic chains of Apex Queueables. Imagine I am "synchronizing" Accounts, Opportunities and Contacts from an ...
5
votes
2answers
545 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 ...
1
vote
1answer
22 views

Chaining Queueables: Does the second job count against the shared limit for asynchronous Apex method executions

When you are chaining Queueables: Does the second job count against the shared limit for asynchronous Apex method executions. I am trying to reduce our number of jobs as we are nearing our ...
0
votes
0answers
51 views

Did not receive exception email in production

We usually get exception emails to our admin from the production. I have a asynchronous code running in production @future public static void processRecords(String FIMCJSONRec) { ...
3
votes
2answers
404 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 (...
2
votes
0answers
934 views

Testing a queueable class containing a future callout [duplicate]

I have a queueable class that makes callouts (@future(callout=true)) in the execute method. When I manually test this, everything works correctly. But when I set up my test class, it gives me the "You ...
2
votes
2answers
369 views

Create Custom Object Share record as Community User

Similar to this question, I cannot create a CustomObject__Share record as a Community User (Customer Community License). Taking the advice provided there, I have created a Share__c object that ...
6
votes
2answers
8k views

Callout Limits for future methods and queueable apex

I'm aware from the docs that "A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call." Is anyone aware if that limit is higher in a future methods or ...
12
votes
1answer
2k views

Uncommitted work pending in unit test with trigger and queueable callout

I have an after insert trigger that invokes queueable Apex which makes a callout. The trigger and callout work fine in the UI and I don't get any errors in normal operation. However, my unit test ...
1
vote
3answers
427 views

I need batch class to process 1cr records

I have almost 1cr records which needs to be updated . i used below batch class. But as per the limit of 10000 Total number of records retrieved by Database.getQueryLocator 10,000 how can i process ...
0
votes
1answer
70 views

Does Queueable Apex job run if parent process crashes?

We are using a custom Email To Case Handler apex class. So that we can keep track of incoming emails if the custom handler crashes for any reason, we have just implemented code at the start of the ...
3
votes
1answer
773 views

Issue with Invocable Method to Call Queueable

Ok, I'm officially confused. I've written some code to attempt to populate a Campaign lookup field on Opportunity based on some logic. The basic flow is Process Builder (so the client can ...
10
votes
1answer
2k views

Chaining Queueables: Clarification & Practical Usage

I am trying to understand what I can and can't do when chaining queueables. I have read several tutorials on this but it seems contradictory that I can't create more than 1 child job, but I can create ...