Hello,
We have a batch job that creates records in a native object.
in that same object we have a trigger with the timings 'after create' and 'after update'. So we want this trigger to run after the records are created through the batch job.
This trigger runs where there is no delay set, but when we add a delay (1 minute for example) to it, it does not run at all.
Is there any limitation with using batch jobs and delayed triggers please?
Thank you
Meryem
As discussed the issue came from the "Run Now" button, and when we schedule the batch Job to run at a particular time, then it is running properly and the delayed triggers are firing correctly as well.
Thank you
Hi MeryK,
I have created FTP import batch job wish will create records in object. And on that same object has SendEmail trigger with After Create timing and With delay 0f 1 Min.
Observed that When the batch job created records email came after 1 min successfully.
Can you please Check "Event Log" for any error in trigger Queue section.
And also provide which type of batch job and which type trigger you trying to use.
Thanks,
Rajkumar
Hi Rajkumar,
We are using a Data Maintenance Batch Job. And an 'Object Script' Trigger that runs after create and after update.
There are no errors in queuing the trigger, on the log file, the trigger simply doesn't run after 1 minute.
Thanks,
Meryem
HI Meryk,
I was unable to reproduce the issue you are mentioning.
I have created a Data Maintenance Batch Job to create records and . And an 'Object Script' Trigger that runs after create.
Its running fine.
Can you please share the sample application?
Please find the the application with which i tried.
Thanks,
Rajkumar
[View:/cfs-file/__key/communityserver-discussions-components-files/25/app_5F00_v3.xml:320:240]
Hi Rajkumar,
Can you please add a select query in the object script trigger you have in your object 'a'.
Actually when we only have a setFieldValue in the trigger it is queued and running properly. But when we add a select query to that trigger it is not queued anymore.
Please kindly let us know.
Thanks,
Meryem
Hi Meryem,
Updated the app with a select query. It is queued and updated the value successfully.
[View:/cfs-file/__key/communityserver-discussions-components-files/25/app_5F00_v4.xml:320:240]
Thanks
Srinivas
Hi Srinivas,
No I don't see the trigger queuing after running the batch job in your app. The trigger is not running at all.
Could it be something to do with permissions ?
Thanks
Meryem
I will open a support case for this.
I imported the XML of your application "app_v4", And I am not seeing the delayed trigger queued after running the batch job.
Thank you
Meryem
Yes, we need to provide Server API permissions for that object.
Thanks
Srinivas
Server API permissions are provided. The issue is still there.
Meryem
While investigating this issue, it was found to be reproducible in 4.2.0.0, but not in 4.2.0.2.
An upgrade to 4.2.0.2 or 4.3.1 (coming soon) should help resolve the problem.
As discussed the issue came from the "Run Now" button, and when we schedule the batch Job to run at a particular time, then it is running properly and the delayed triggers are firing correctly as well.
Thank you