Note: I didn't fully test this, but I've done something similar. You may need to slightly adjust this process to suit your needs.
You couldn't do this with a Workflow Rule, but you could use the Process Builder for this. Basically, you'd do this:
Setup > Create > Workflow & Approvals > Process Builder
Create a New Process Builder
Click the "New" button. Provide a "Process Name", "API Name", "Description", and choose This process starts when "A record changes", and finally "Save" this Process Builder.
Select the Object
Click on "+ Add Object", specify Object "Account", and Start the process "when a record is created or edited", and finally "Save" your changes.
Configure Entry Condition
Click on "+ Add Criteria", add a Criteria Name, and in the Set Conditions area, choose ABCD Grid Equals Global Constant "$GlobalConstant.Null", and click "Save" (we'll add the remaining two conditions in a moment).
Configure Immediate Actions
Click on "+ Add Action", choose Action Type "Update Records", set Action Name "France", then the Record Type "Select the Account that started your process", and then "Choose". After that, select Criteria for Updating Records "Updated records meet all conditions", and enter Record Type Id Equals Formula "if([Account].RecordType.Name='FR',[Account].RecordTypeId, Null)". Finally, specify the field to update, and set the type and value you desire. Click "Save" to complete this action. Repeat the process for Italy, replacing FR with IT as appropriate.
Activate the Process
Once you're satisfied with how it looks, click "Activate" to make it active, and then test it out.
If this seems like a lot of work, it is. However, the Process Builder has a lot more power under the hood and can do things that workflow rules are not capable of. However, unless you're really pressed for workflow rules (e.g. you're nearing the per object or global rule limit), you should probably just write two workflow rules with two field updates instead. It takes significantly less time to set up, and is easier to maintain than using a Process.
This is what I did to get this tested and working:
- Field
Delay__c
on account. Default value = 0 you can alter in increment formula
2. Field Send_On__c
(dateTime) formula as createddate + Delay__c
- WFR ON Account, eval criteria Created and subsequently edited, criteria
CreatedDate NOT EQUAL (leave third field blank)
and Delay__c <= 9
3a. Immediate Actions - WF Field Update to increment Delay formula. In this example if 0 add 3 days, otherwise add 1.
3b Email alert to send email of your choosing
3c Time triggered 0 days from Send_On__c
as the trigger
3d - Time triggered actions is the same as exist in the immediate actions
Feel free to rename fields as needed. You could also simply adjust the formula to increment times triggered to add 2 if the value is 0, then 1 otherwise. All up to you.
What this does is:
Record Created, immediate action happens, sends email, increments counter. Now Send_On__c = next day + 3 if insert and next day when TBWFR fires.
Next Send On day, time triggered fires, increments counter, sends email, and resets itself to the next day to fire
To test:
- Create record - You will get email
- Review TBWF queue. - You will see an entry for tomorrow
- Increment counter manually to 2 to simulate tomorrows run
- Review TBWF queue. - You will see an entry for 2 days for now
On insert the TBWF Queue should should something similar to:
And the account fields will be
Now, change the Delay to 4 and refresh the TBW Queue logs and it should be
Best Answer
From the help docs:
I bolded the 2 you would need to use.