Questions tagged [asyncapexjob]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2
votes
1answer
48 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
1answer
37 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 ...
1
vote
1answer
101 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 ...
0
votes
2answers
282 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
1answer
27 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
1answer
73 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....
0
votes
2answers
347 views

Providing date in custom label and use it in my apex class

I have a requirement where I have written batch class to delete old records(Have to house keep old records for many objects as we don't use them). Just to test it I have created it in my Dev org for ...
1
vote
1answer
60 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
1answer
22 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
1answer
57 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
1answer
56 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
2answers
321 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
1answer
55 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. ...
0
votes
1answer
545 views

How to call AsyncApexJob in test class from batch class finish method

here code is passed and code code coverage is not coverd, Please help me any one Test class test.startTest(); // UpdateOppToInitialize.UpdateOppToInitialize(); UpdateOppToInitialize obj = new ...
1
vote
3answers
320 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 ...
3
votes
0answers
119 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
1answer
137 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
1answer
59 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
2answers
18 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
1answer
135 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
1answer
121 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
3answers
835 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
1answer
223 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 ...
3
votes
2answers
3k 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
3answers
656 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
1answer
774 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
0answers
73 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
1answer
183 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....
-3
votes
1answer
519 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 ...
1
vote
0answers
211 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>(); ...
2
votes
1answer
20 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 ...
5
votes
1answer
2k 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 ...
0
votes
0answers
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/...
4
votes
1answer
3k 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 ...
2
votes
0answers
251 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 ...
23
votes
1answer
2k 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 ...
0
votes
1answer
81 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 ...
0
votes
1answer
335 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 ...
7
votes
1answer
2k 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 ...
1
vote
1answer
554 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 ...
1
vote
1answer
203 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 ...
2
votes
2answers
5k views

Retrieve a list of currently running jobs

I'm building a system that will be calling executeBatch on quite a few batch apex jobs. I want to make sure that I haven't already hit the limit on the max number of jobs queued up. I believe ...
1
vote
1answer
625 views

Can a future method conflict with a queuable method?

My custom code is executed using a queuable class. Sometime it runs perfectly, other times it gives this error: Failed to update list. Error: System.DmlException: Update failed. First exception ...
7
votes
1answer
339 views

Is an AsyncApexJob record inserted immediately at the end of a transaction?

Is an AsyncApexJob record inserted immediately at the end of a transaction or is it possible that there is a delay between those two events? I couldn't find firm guarantee in the documentation on that....
4
votes
1answer
272 views

Are start() methods of batches guaranteed to run sequentially?

The question is very similiar to this one: Are batch jobs guaranteed to run sequentially? I basically want to ask the same thing, except this time for start() method. Do start() methods of ...
5
votes
1answer
216 views

AsyncApexJob table has additional record initially? platform bug?

I noticed when creating a new dev org, and running my first batch job. I then query the AsyncApexJob table and there are 2 records instead of the expected 1. There seems to be a default record in ...
0
votes
0answers
121 views

Callback on completion of AsyncApexJob

Is there a way to have Apex code execute when an asynchronous job finishes? I want to solve this problem without polling (which seems to be the dominant solution).
2
votes
0answers
162 views

When does System.abortJob() take effect with regards to a transaction?

If I call System.abortJob() in a transaction, when is the job actually aborted? Does it happen immediately, or only once the transaction is committed? I suspect the latter, as you don't want to have ...
1
vote
0answers
241 views

How to get the batch jobs result

I hava a simple requirement in my project,i need to pull data from outside service via calling restful api and push salesforce data to outside service with same way. so,the problem is the data is very ...
0
votes
2answers
83 views

Queuable interface calls many times

I'm calling a queuable interface via a trigger afterupdate. this queuable interface is allowing callouts to an external webservice ( Database.AllowsCallouts ). When I check the apex jobs, I found ...