Questions tagged [asyncapexjob]
The asyncapexjob tag has no usage guidance.
95
questions
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 ...
-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.
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 ...
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":&...
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 ...
-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....
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 ...
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 ...
...
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 ...
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 ...
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 ...
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 ...
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?
...
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?
...
-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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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()
...
-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<...
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 ...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
-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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
-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='...
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 "...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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....
-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 ...