Let's define some identifiers before we start, in order to make things clear.
- I have some Account objects and some related Opportunity objects.
- Each Account object has a Access__c field.
- Each Opportunity object have a start date and an end date fields.
My requirements are that:
- once an opportunity begins to start(the day of start date), we need to set the Access__c field of it's related Account to be Yes.
- once an opportunity begins to finish(the day of finish date), we need to set the Access__c field of it's realted Account object to be Expired.
Please note that I can not use Apex Trigger to help me with this, becasue from my understanding, apex trigger need a explictly event like object insert/update/delete to trigger the pre-defined action.
However, in my case, there are no such event, but a date field. We want the Access__c field to be updated automatically based on the date field.
After some research, I tried to do it by time-dependent workflow.
So I added two time-dependent trigger(not apex trigger) in my workflow.
- One action is to set Access__c to be Yes when date equals to start date of Opportunity.
- The other action is to set Access__c to be Expired when date equals to end date of Opportunity.
For example we have the following objects.
- Account A1 has two related opportunities O1 and O2.
- O1 has start date d1 and end date d2.
- O2 has start date d3 and end date d4.
- O1 is added to A1 first, and O2 was added to A1 later.
- d1 and d2 are less than d3 and d4.
Let's consider a general case where we have A1,O1,O2 with d2 + 5 = d3.
This means that, the second Opportunity begins to start 5 days after the first Opportunity finish.
According to my pre-defined workflow, - The Access__c of A1 will be updated to Expired at d2. - And 5 days later, at d3, the Access__c of A1 will be updated to Yes. - My workflow works well for this general case.
But let's consider one more specific case where d3=d2.
According to my pre-defined workflow,
At d2, the Access__c of A1 will be updated to Expired. (1)
At d3, the Access__c of A1 will be updated to Yes. (2)
Since d2=d3, the above two actions will be executed at the same time. What's more, the are updating the same field with different values.
Even thought, I can see my scheduled actions (1) are listed before (2). But I'm not sure if they are executed according to the list sequence.
Can someone confirm if the scheduled actions will be executed exactly according to the sequence list?
Or can someone provide me a way to make sure that (1) is executed before (2).