You need to sign in to do that
Don't have an account?
SFDC New User
Apex Queue Data sync
Hi,
The apex queue submitted thru @future job, when it being processed, does it query the real time data from the object to process or using the data value as at the queue submitted time?
E.g.
At 01:00am, Trigger on account submitted a record A : Name = Apple, -- still pending in the queue for process (job 1)
At 01:05am, Record A, Name changed to : APPLE -- job 1 still in pending queue, job 2 is queued
At 01:10am, job 1 is finally processed, does it take Apple or APPLE for processing?
Anyone know?
Thank you.
The apex queue submitted thru @future job, when it being processed, does it query the real time data from the object to process or using the data value as at the queue submitted time?
E.g.
At 01:00am, Trigger on account submitted a record A : Name = Apple, -- still pending in the queue for process (job 1)
At 01:05am, Record A, Name changed to : APPLE -- job 1 still in pending queue, job 2 is queued
At 01:10am, job 1 is finally processed, does it take Apple or APPLE for processing?
Anyone know?
Thank you.
As per the queueing model in Salesforce, it should take APPLE, as you get the latest data when the job is run in the future. You should usually choose to use future methods only when the result of the method does not get affected by these kind of dependencies.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.
Thanks,
Shashank
All Answers
As per the queueing model in Salesforce, it should take APPLE, as you get the latest data when the job is run in the future. You should usually choose to use future methods only when the result of the method does not get affected by these kind of dependencies.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.
Thanks,
Shashank
If @future method is called from trigger we will have the following steps:
start trigger execution context
At 01:00am, Trigger on account submitted a record A : Name = Apple , run @future (job 1)
stop trigger execution context (Name = Apple is committed)
start execution context of job 1
start execution context of job 2
At 01:05am, Record A, Name changed to : APPLE
stop execution context of job 2 (Name = APPLE)
At 01:10am, job 1 Name equals to APPLE
stop execution context of job 1