Questions tagged [asyncapexjob]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
34 views

For the Apex jobs that failed to execute, what is/should be the next action we need to take in order to determine the job run time?

For the Apex jobs that failed to execute, what is/should be the next action we need to take in order to determine the job run time?
user avatar
1 vote
0 answers
48 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? ...
user avatar
  • 195
-3 votes
1 answer
151 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. ...
user avatar
0 votes
0 answers
137 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 ...
user avatar
2 votes
1 answer
67 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 ...
user avatar
0 votes
1 answer
88 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 ...
user avatar
0 votes
1 answer
74 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 ...
user avatar
  • 461
0 votes
1 answer
108 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 ...
user avatar
  • 125
2 votes
2 answers
653 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
user avatar
0 votes
0 answers
350 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 ...
user avatar
0 votes
1 answer
468 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() ...
user avatar
  • 5,435
-2 votes
1 answer
221 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<...
user avatar
0 votes
1 answer
174 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
1 vote
2 answers
3k 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 ...
user avatar
  • 197
1 vote
1 answer
57 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 ...
user avatar
  • 129k
0 votes
1 answer
950 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....
user avatar
  • 1,516
1 vote
1 answer
107 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 ...
user avatar
  • 31
1 vote
1 answer
30 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 ...
user avatar
0 votes
1 answer
168 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 ...
user avatar
  • 205
0 votes
1 answer
103 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 ...
user avatar
-2 votes
2 answers
1k 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 ...
user avatar
1 vote
1 answer
168 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. ...
user avatar
  • 444
1 vote
3 answers
703 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 ...
user avatar
4 votes
0 answers
243 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 ...
user avatar
  • 9,416
0 votes
1 answer
263 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 ...
user avatar
  • 315
0 votes
1 answer
88 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 ...
user avatar
  • 1,080
-3 votes
2 answers
21 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='...
user avatar
0 votes
1 answer
250 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 "...
user avatar
  • 2,325
1 vote
1 answer
184 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 ...
user avatar
  • 675
0 votes
3 answers
1k 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 ...
user avatar
6 votes
1 answer
359 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 ...
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 ...
user avatar
1 vote
3 answers
1k 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 ...
user avatar
  • 2,122
1 vote
1 answer
1k 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 ...
user avatar
3 votes
0 answers
103 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 ...
user avatar
  • 1,410
0 votes
1 answer
280 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....
user avatar
  • 2,122
-3 votes
1 answer
811 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 ...
user avatar
1 vote
0 answers
249 views

How can I create a meaningful test of a function which creates a Queueable which posts Announcements through the ConnectApi?

I have this method: public Id doPostAlerts(List<Product2> productList){ List<ConnectApi.AnnouncementInput> announcementInputList = new List<ConnectApi.AnnouncementInput>(); ...
user avatar
2 votes
1 answer
21 views

How do I expose background tasks to end users?

My users sometimes kick off some long-running background processes (e.g., add 150 records that look like this template, run this batch process, etc.). Right now, if those processes fail, they are not ...
user avatar
5 votes
1 answer
3k views

Can't Save Class (batch or future jobs pending or in progress)

I have a problem saving one of my classes into server. The error that I get is: Error: Compile Error: This Apex class has batch or future jobs pending or in progress at line -1 column -1 I have ...
user avatar
  • 305
0 votes
0 answers
18 views

What besides a batch process/future call can update an opportunity on a schedule?

We have this weird issue where certain opportunities are being updated around the same time each day, but I cannot figure out for the life of me how this is happening. There are no batch processes/...
user avatar
  • 988
4 votes
1 answer
5k views

How can I tell batch job finished executing the finish() method?

In my controller I want to know when my batch job has fully finished running; not just the execute method but also the finish. I have tried the following and both seem to return true when execute has ...
user avatar
  • 3,754
2 votes
0 answers
415 views

All attempts to execute message failed, message was put on dead message queue

I have a process that is chaining Queuables using a future method similar to this: public class MyQueuable implements Queueable{ public virtual void execute(QueueableContext context){ //do ...
user avatar
  • 9,416
25 votes
1 answer
4k views

Dramatic increase in AsyncApexJob latency

Problem Salesforce is a multi-tenant platform and as a consequence the time for an asynchronous request to be dequeued may vary. This is not a problem for us, as long as the delays stay within ...
user avatar
0 votes
1 answer
91 views

VisualForce : Error CPU time limit exceeded in scheuled job

I have a scheduled job that sends page content via email, page controller needs about 15 sec to finish executing(looping over histories of more than one object) so sometimes scheduled job fails ...
user avatar
0 votes
1 answer
478 views

How to delete Batch Process Logs in Salesforce?

Was running some tests in my dev org and got this: System.DmlException: Insert failed. First exception on row 0; first error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded: [] I know the issue ...
user avatar
  • 651
7 votes
1 answer
4k views

Check if an SOQL query is valid without actually executing it

I'm building a system where a user will be providing me with a query through a UI. This query will then be used in an Async Apex Job, by passing it as a param to Database.getQueryLocator in the start ...
user avatar
  • 651
1 vote
1 answer
829 views

Rollback all completed jobs in a chain

I'm writing an application where I'm chaining jobs by calling executeBatch for the next job in the finish method of the previous one. In case a job somewhere in the chain fails, I'd need to rollback ...
user avatar
  • 651
2 votes
1 answer
386 views

Governor limits in dispatching BatchApex jobs - how much and where to find them?

As a follow up to this question, here are some questions I've not been able to find an answer for: How many batch jobs can you dispatch before you exceed governor limits? 100 or 105? Do scheduled ...
user avatar
  • 651