You need to sign in to do that
Don't have an account?
Apex Job not running asynchronously in Trigger
Hi,
I am running Apex Job in before delete trigger and noticed the deletion of a single Campaign through Salesforce interface takes around 34 seconds and Apex Job has completed running when the Campaign is deleted using Salesforce interface. When I run the same Apex Job on the same number of records (15,000) using VisualForce page runs instantly, the job is queued and runs after the VisualForce page has completed.
In this screen shot the first job was queued using VisualForce and the second and third were queued using trigger:
As you can see although the same number of records (15,000) are processed by the same Apex Job when it is queued using Trigger no batches are created (at least according to the user interface) and based on Submitted and Completed date the job is not Asynchronously.
Apex Job is queued like this:
BatchDeleteResults batch = new BatchDeleteResults(); batch.deleteQuery = deleteQuery; ID batchId = Database.executeBatch(batch);
Has anyone else experienced something like this?
Thanks,
I still haven't been able to figure out a reason why Apex Job is not running asynchronously.
This is the trigger (object names changed but the logic is same)
and this is the Apex Job:
Anyone know what the issue could be?
Thanks.