Questions tagged [asyncapexjob]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Destructive Deployment Error: This apex class is referenced elsewhere in salesforce.com. Remove the usage and try again. : Apex Job - 7073u0000****** [duplicate]

I am trying to delete a batch class from production that was 1) scheduled and 2) called from another batch class which was also scheduled. The reference to this class was removed from the second batch ...
Shanerk's user avatar
  • 1,042
-1 votes
1 answer
32 views

Queueable Apex Running For Long duration

I am triggering a queueable apex but the class running for very long duration is very small class and perform apex sharing.
Mkg789's user avatar
  • 1
4 votes
1 answer
85 views

Can't find Apex Jobs that are blocking deployment

I am trying to delete a couple of old unused Apex Classes in our Production. Every time I try to delete all or one of them I get the following error message: "This apex class is referenced ...
Florian's user avatar
  • 43
0 votes
0 answers
142 views

System.AsyncException: Database.executeBatch: batch apex job enqueue failed

I have a batch class which updates a set of records with data from an external system. About twice a month or so, this exception is thrown: errorCode":"APEX_ERROR","message":&...
Gabriel Gonzalez's user avatar
2 votes
0 answers
62 views

Apex Engine old Version of apex code changed?

Recently (since January) we have encountered some cases when deploying new versions of our managed package. We have had at least 2 separate instances where changing a batch or an apex class referenced ...
Jose's user avatar
  • 2,092
-3 votes
1 answer
553 views

How to get success count and error count in batch apex [closed]

public void finish(Database.BatchableContext bc){ AsyncApexJob a [Select Id, Status, ExtendedStatus, NumberOfErrors, JobItems Processed, TotalJobItems, CreatedBy.Emailfrom AsyncApexJob where Id =:bc....
Guest's user avatar
  • 3
4 votes
2 answers
527 views

How to avoid running a batchable when an instance is already running?

We have several batchables that if run in parallel trample over each other's results. So I want to block a second invocation if there is already one running and just tell the user to wait. My first ...
Keith C's user avatar
  • 134k
1 vote
0 answers
91 views

AsyncApexJob.CronTriggerId present but no actual CronTrigger record

Maybe it has always been this way but ... If you execute System.abortJob(id), the AsyncApexJob.CronTriggerId still retains a value but there's no CronTrigger parent record Given the following code ... ...
cropredy's user avatar
  • 69.1k
1 vote
1 answer
897 views

AsyncApexJob returning two records for one executed instance of batch

When I am executing one batch then that batch runs only once. I have verified it from the 'Apex Jobs' from Setup. But when I am querying the AsyncApexJob for that batch class, it is returning two ...
Muskan Agarwal's user avatar
1 vote
0 answers
406 views

Governor Limits: Scheduled Flows vs Async Apex

tl;dr - Do schedule flows (flow builder, not process builder) count against the same limit of scheduleable jobs that asynch apex (Queueable, Scheduleable, Batch) is limited by? If not, in what way to ...
Jwok's user avatar
  • 757
1 vote
1 answer
334 views

How to differentiate the batch class based on the different parameters passed and fire different email based on the parameters when batch class fails

I have a batch class which performs certain DML operation in execute method based on certain conditions. Also performing an update under finish method. I have a constructor where parameters of type ...
Sudharsan's user avatar
0 votes
1 answer
196 views

Heapsize error on Queueable class

I have a queueable class and I am doing a REST Callout. I am sending 2 files that are less than 12MB. When I run the code I am getting a Heap size error. Salesforce document says if you use Asyncrous ...
Tamil's user avatar
  • 714
0 votes
1 answer
877 views

How can we get the Scheduled Job's Apex class and cron expression by scheduled Job Name?

Example: old developer scheduled an apex class by cron expression.But the scheduled job name is not given properly. Then how can we know that apex class by job name to verify what is that job doing? ...
Naveen Bayya's user avatar
2 votes
0 answers
394 views

Iterable in apex batch start

Iterable had an upper limit of 10000 records in batch apex earlier, when used as return type for start method. However in docs, I cant seem to find it anymore. Is this limit removed or not relevant? ...
Amit's user avatar
  • 344
-3 votes
1 answer
2k 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. ...
Sautul Mehta's user avatar
0 votes
0 answers
904 views

Scheduler: failed to execute scheduled job: AsyncApexJobObject, reason: You have exceeded the maximum number (100) of Apex scheduled jobs

I have implemented is a Schedulable Interfaced class, which I have scheduled to run every day at a certain time. In a nutshell, it runs a for-loop inside which, I use: system.scheduleBatch method to ...
Nikhil Somvanshi's user avatar
2 votes
1 answer
414 views

Method not getting called after addError, Please advise

I am new to SFDC please help. Requirement: Restrict user deactivation if Account is owned by the user and send an Email with details. Trigger on user object: trigger userTrigger on User (before ...
Alpha1331's user avatar
0 votes
1 answer
298 views

Can an Asynchronous Trigger run parallelly with Batch Apex/Future/Queueable or it's added in queue

I am planning to write an Asynchronous Trigger but I am not any documentation, if Async Trigger can run parallelly with other async process or it's added in queue based on availaible resources. Thank ...
sfdeveloper's user avatar
0 votes
1 answer
217 views

How to not abort jobs that are already aborted?

I have a function that gets called as part of reschedule logic in a Shedulable Apex class that implements System.Schedulable. The following code only gets called when a reschedule is needed. Rather ...
kratos's user avatar
  • 521
0 votes
1 answer
416 views

Choose async or sync based on amount of data returned or trigger size?

Can anybody guide me through any framework which I can refer in order to achieve this use case?I am not able to get my head around it on how to do it efficiently. I want to process records in near ...
Isha's user avatar
  • 163
2 votes
2 answers
3k views

Why should we use Queueable apex when we can perform chaining of batches in batch apex (when we can call another batch in the finish method)

We can call another batch from the finish method of one batch, then why do we need Queueable apex
paritosh parimal's user avatar
0 votes
0 answers
864 views

Session not found - Session Cache not supported

In my async apex future method, I am getting an error "Session not found - Session Cache not supported". An apex class called by the future method is accessing the session cache. This should ...
KayPatel's user avatar
0 votes
1 answer
2k 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() ...
Saariko's user avatar
  • 5,541
-2 votes
1 answer
368 views

Apex Job Error: can't parse argument number: org

can someone please help me with this issue can't parse argument number: org: This is the Batchable class: global with sharing class IMB_SendPushNotificationsBatchable implements Database.Batchable<...
Šejla Jahić's user avatar
0 votes
1 answer
560 views

Next Scheduled Time gets null after execution of a scheduled Job. Asynchronous Apex

I was working with Scheduled apex and it seems quite simple that you define a cron expression and then simply schedule it and later on you can monitor the progress of your job under scheduled jobs and ...
Usama Ahsan's user avatar
2 votes
1 answer
4k views

Get the scheduled Job name using Apex class name

I have seen many posts about finding out name of the apex class associated with a scheduled job. However, i have an opposite need. I am updating a scheduled class, that was scheduled to run at a ...
user2957592's user avatar
2 votes
2 answers
7k 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 ...
Hunt's user avatar
  • 215
1 vote
1 answer
102 views

Any way to reliably navigate to the Apex Jobs page in both Classic and Lightning from a Visualforce page?

In some basic setup UI written in Visualforce, I want a link that takes the user to the "Apex Jobs" page in both Classic and Lightning. I note that "/707" (the key prefix for AsyncApexJob) does not ...
Keith C's user avatar
  • 134k
0 votes
1 answer
3k 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....
sfdc_to_learn's user avatar
1 vote
1 answer
332 views

How can I save a class when a batch job is running (without the Ant tool)

I am trying to figure out if we can save a class which is used in a batch job. I am unable to save a class. I can't save the class when a batch job is running. I don't want to abort the job. Is there ...
Malik's user avatar
  • 31
1 vote
1 answer
40 views

how quable solves the problem of having soobjcets in future mthods?

As per my knowledge both future and quable are async methods ,we don't know when they run,that's y we cant pass sobjects as parametrs in fuute methods(i read in future trailhead) because objects state ...
Ganesh Thota's user avatar
0 votes
1 answer
332 views

Async apex job aborted manually from Apex Jobs Monitor - any way to catch that from the batch class?

I've just learned that finish() is never called when a batch job is aborted manually by a user from the Apex Jobs monitor. However, I would like to be able to run some logic in a batch class when its ...
user73893's user avatar
  • 305
0 votes
1 answer
209 views

How can I handle in Apex if a new Apex Job is enqueued

I would like to know if there is a way to handle the creation of a new Apex Job inserted the Flex Queue, since the object AsyncApexJob is not supported in Triggers. I was also considering handling an ...
A.S's user avatar
  • 1
-2 votes
2 answers
2k views

what is the parameter database.batchablecontext?

I was learning batch apex and it has three method which is start,execute and finish. Each method has a parameter Database.BatchableContext. What is this parameter and why it is being used in all ...
Ratnesh's user avatar
1 vote
1 answer
380 views

I am trying to Schedule Class that will add a new contact under Account every 2 min

I am trying to Schedule Class that will add a new contact under All Account every 2 min and also there should be a validation check that you can not have more than 05 Contacts under a single Account. ...
Dave's user avatar
  • 480
2 votes
3 answers
1k 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 ...
Jayakrishnan Salim's user avatar
4 votes
0 answers
493 views

AsyncApexJob: TotalJobItems != JobItemsProcessed + NumberOfErrors

I'm running into an odd issue where AsyncApexJobs (from Batch Apex) are finishing with a status of "Complete" but the TotalJobItems != JobItemsProcessed + NumberOfErrors. Should I be concerned that ...
NSjonas's user avatar
  • 10k
0 votes
1 answer
584 views

Find job status using the id returned from Database.executeBatch?

I have a class that is Database.Batchable which I execute via Database.executeBatch. How do I find the job status Id using the id returned from Database.executeBatch? It doesn't seem to match the Id I ...
ploc's user avatar
  • 315
0 votes
1 answer
149 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 ...
Peter Noges's user avatar
  • 1,090
-3 votes
2 answers
23 views

While trying to run ScheduleApex it give error

//This is code global class Schedule1 Implements Schedulable{ global void execute(SchedulableContext sc){ List<Account> accounts=[SELECT ID,NAME,INDUSTRY FROM ACCOUNT WHERE NAME='...
Bikash Pradhan's user avatar
0 votes
1 answer
387 views

Scheduled Job occassionally does not reschedule for next run

I haver a scheduled job that runs every fifteen minutes. It runs fine for several months and then randomly it will stop running and doesn't reschedule for the next run. The apex jobs showed an "...
Dman100's user avatar
  • 2,415
1 vote
1 answer
259 views

AsyncApexJob record when I use System.scheduleBatch() method

I have just found a very strange behavior regarding Batch. If I have a Batch and run it using the method Database.executeBatch(), a new record inside AsyncApexJob table is created and I can use ...
vt89's user avatar
  • 725
0 votes
3 answers
2k views

Is asynchronous apex either rolled back or not executed if the original transactions fails?

I would like to confirm the behaviour of asynchronous apex when an error occurs on its original/parent transaction. Imagine we have a synchronous apex transaction (Transaction1-Apex) that launches a ...
Pere Marti's user avatar
6 votes
1 answer
540 views

ApexTestRunResult's status is set to complete and all tests pass, but the enqueued and completed count do not match

It is possible to programatically run tests in the platform by creating ApexTestQueueItem records. They reference classes by their Id, and you can even optionally specify if you want the test to ...
Renato Oliveira's user avatar
4 votes
2 answers
4k views

What's the difference between AsyncApexJob and CronTrigger?

Roughly I know that when I schedule a Schedulable, I'm creating both a CronTrigger and an AsyncApexJob, but I'm confused as to how the two objects relate to each other and what the significance of ...
user823447's user avatar
1 vote
3 answers
2k views

Getting the job id of a chained job from the id of the parent job

I have a Queueable job that will initiate a Batch job. I have a transaction that enqueues the Queueable job and returns the id of the Queueable job. However, I need to be able to get the id of the ...
Jorjani's user avatar
  • 2,192
1 vote
1 answer
2k views

How is calculated "24-hour period" for the limitation of Asynchronous Apex Executions

I have a question regarding Execution Governors and Limits for daily maximum number of asynchronous Apex method executions. In the Salesforce documantation it is written, that the maximum number of ...
R.Paunova's user avatar
3 votes
0 answers
135 views

schedule jobs to be run in the past

I have a scheduled job whose "Next Scheduled Run" is set to a date in the past: Cron expression: 0 30 20 * * ? * Does it mean that this scheduled job will never run? What could be the reason for ...
Cuban coffee's user avatar
  • 1,520
0 votes
1 answer
338 views

Test.stopTest() does not run @futureJob called from an enqueuedJob

I have a future job that is called from an enqueued job. The code works fine when I run manual tests; however, when my test class, which looks like the code below doesn't finish the future job: Test....
Jorjani's user avatar
  • 2,192
-2 votes
1 answer
1k views

How to send an alert notification if Async Apex execution limit reached 70%of limit

I want to send an alert notification when overall organisation Async Apex Execution limit reached 70%of total limit. Say if limit is 2500 and if system already exhausted 1750 of daily Async Apex Limit ...
Harjeet Singh's user avatar