 Hello friends. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate how you can implement time dependent work through actions in workflow rules in Salesforce. So if you want to watch Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel. So first of all, I'm searching for workflow rules. So I have a couple of workflow rules already created. So I'm going to modify them so that we can see how we can implement time dependent workflow actions. So here you can see I have one workflow rule, which is for send email alerts and rule criteria is if contact lead source field is equals to web, it will be fired and evaluation criteria is evaluate the rule when a record is created and anytime it's edited to subsequently meet criteria. So first of all, I'm clicking on edit so that we can see there are three evaluation criteria. So if you select created, then you can implement time dependent workflow actions for this. If you select this one created and every time it's edited. So for this, you cannot add time dependent workflow actions with this option. So, whenever you are going to add time dependent workflow actions. So you need to select created or created and anytime it's edited to subsequently meet criteria, you can't choose second evaluation criteria for time based or time dependent workflow actions. Right. So I'm choosing this third option. Now I'm clicking on save. Now to add time dependent workflow actions, you need to click on edit but here you need to read this warning message. Here the message is written which is you cannot add new time triggers to an active rule. So you can see this workflow rule is active right now. So if you want to add time dependent workflows, so you need to click on deactivate first after deactivating this workflow rule, we can add time dependent workflow actions. So this workflow rule is having one immediate workflow action that is email alert so it will be executed whenever this rule is fired. Now I'm clicking on edit so that we can add time dependent actions as well. So first we need to add time trigger. So if you click on time trigger so you will see these four input boxes so you need to set numeric value according to days and hours. So let's say I'm putting one or you can set before or after right and then various date fields are available here. So rule trigger date, birth date, created date, etc. So you can choose any particular date as per the requirement. So let's say I'm selecting rule trigger date so whenever this rule will be triggered. So after one hour this time dependent workflow action will be executed. So I'm clicking on save. So this way you can set the time. Now you can add workflow actions. So let's say I'm adding new email alert. So email to contact as per time based. Now I'm selecting an email template then email field. So contact has email field so I'm selecting that one. And here you can put additional emails then from email is current user email address and I'm clicking on same. So this way I added time as well as time dependent action. So one action is immediate action that is also email alert. One is time dependent action that is also email alert. So two emails will be sent one immediately and one after one hour of rule trigger date. Right. So this way you can add time dependent book options. Now after adding this you need to click on done. Now you can activate it. So right now our rule is activated. So now I am opening one more tab. So I'm opening new tab. So in this tab I'm going to show how you can check whether time dependent actions are executed or not. So if you want to check them so you can open time based workflow. So you need to search for this. So if you click on this so time based workflow window will be appeared. So here you can see well Salesforce.com triggers a workflow rule. It's time dependent actions are placed in the workflow queue. So use the criteria below to monitor the queue. So from here you can choose these things. So let's say I'm selecting object equals and we implemented this on context. So I'm searching for content. So it is showing that right now no time dependent workflow action is available. So that is not any action is not available in the queue because rule is not fired. So now I'm going to fire this rule. So rule criteria is lead source will be having value as web and it will be happen on created and whenever we add it to subsequently the criteria. Right. So now I'm going to open our application. So it is my university application. So here we have one tab that is for contact object. Right. So let's say I'm creating new. Contact. So they miss time based email in email. I'm filling. So this is the email. Lead source is bad and I'm clicking on save. So you will see one email will be sent immediately that will be available in the mailbox. So I'm in my mailbox. So you can see one email is available here. That is due to immediate action. Now we need to check this time based workflow queue. So I'm clicking on search again. So here you can see time based email that is record name. Object is contact workflow name is send email alerts schedule date created by and created it. Right. So here you can see created it is 952 and schedule date is 1052 because in our rule criteria. In our workflow rule we set time as one hour after rule trigger date. Right. So it will be sent after one hour. So it is available in the queue. So this way you can see. At time dependent for questions. So they will be available in the queue and you can also check them. Right. Now, whenever you update your record and let's say your rule criteria doesn't matches. So I'm opening details. So right now lead sources that let's say in some scenario you modify this to any other value and you click on save. So right now your rule criteria for valid for workflow rule is not matching. This is not matching. So that record from the queue will be removed automatically. So now if I click on search again, so you can see it is removed automatically because right now your record is not having lead source as web so that your workflow rule rule criteria is not matching. So I hope you understood whenever rule criteria matches for your time dependent workflow actions will be available in the queue. And if you change your fields and rule criteria doesn't matches. So the record that is available in the time base queue will be removed automatically. So I hope you understood how we can set immediate workflow actions as well as time dependent workflow actions and how we can check a time based workflow records with the help of this queue. So if you want to watch more Salesforce training videos you can search my name Sanjay Bhaktan YouTube and you can follow my YouTube channel. Thank you for watching this video.