[4.2.0] - Batch Jobs and Delayed Trigger

Posted by Meryk on 21-Sep-2016 11:58

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

Posted by Meryk on 21-Oct-2016 04:35

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

All Replies

Posted by Rajkumar Mateti on 22-Sep-2016 01:24

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

Posted by Meryk on 22-Sep-2016 03:48

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

Posted by Rajkumar Mateti on 22-Sep-2016 05:50

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]

Posted by Meryk on 22-Sep-2016 06:42

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

Posted by Srinivas Panyala on 22-Sep-2016 07:15

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

Posted by Meryk on 22-Sep-2016 08:16

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

Posted by Meryk on 22-Sep-2016 08:31

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

Posted by Srinivas Panyala on 23-Sep-2016 00:40

Yes, we need to provide Server API permissions for that object.

Thanks

Srinivas

Posted by Meryk on 23-Sep-2016 03:59

Server API permissions are provided. The issue is still there.

Meryem

Posted by Karthikeyan Bhaskaran on 28-Sep-2016 07:11

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.

Posted by Meryk on 21-Oct-2016 04:35

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

This thread is closed