what is workflow Rule in Salesforce Salesforce fully Explained using Scenario based discussion

Workflow Rule Scenario Based Discussion:


Workflow Rule is automation process in Salesforce which activates /invokes depending upon the changes performed to the database .

For example when new record created/ any of the existing record updates/modified ,we can configure action to perform automatically.

Please do read till the end ,You get an clear idea on the concept .

Navigate to Your Name > Setup > App Setup > Create > Workflow & Approval > Workflow Rules. 


Evaluation Criteria :

Salesforce will evaluate the rule when a record is:
1. created
2. created, and every time it’s edited
3. created, and every time it’s edited to subsequently meet criteria. 

Created:
Whenever a record is created and the criteria matches the record, Workflow Action will be executed .

created, and every time it's edited :

Whenever a record is created OR Updated the action will be executed.
Created and every time it’s edited to subsequently meet the criteria:
Whenever a record is created and it stands true to the criteria, the action will be performed. Now, if the record is edited and it doesn’t meet the criteria, the action will not be performed.
The created record doesn’t meet the criteria, and it is now edited or updated. It will be evaluated again, and if it meets the criteria, the action will be performed. Otherwise, it won’t be performed .

Created and edited it and Created Vs every time it’s edited to subsequently meet the criteria:(Important) :
Many of you might be confused between both of these Evaluation Criteria .Its time to clear the confusion...:)
1.created, and every time it's edited:
Whenever record is created or Updated ,If the criteria of the workflow rules matched ,Workflow rule will be triggered .
For example if you configured Criteria as When Status ="InProgress" ,An email should be triggered to record owner below actions will be triggered :
a.Whenever record is created with Status ="InProgress"  ,Then Email will be triggered to owner .
b.Whenever an Existing record is updated with Status ="InProgress"  ,Then Email will be triggered to owner .
c.But if the existing record Status ="InProgress" already ,But if you update the record with some other field(update phone number) without changing record Status then also Email will be Triggered to owner again since Rule again matches with the existing Criteria of  record Status ="InProgress"  even though you do not change the status.
2.every time it’s edited to subsequently meet the criteria:
Let us take same example as above and lets see the difference :
For example if you configured Criteria as When Status ="InProgress" ,An email should be triggered to record owner below actions will be triggered :
a.Whenever record is created with Status ="InProgress"  ,Then Email will be triggered to owner .(Same as above)
b.But if the existing record Status ="InProgress" already ,But if you update the record with some other field(update phone number) without changing record Status then NO Email will be Triggered to owner again since Rule already  matched with the existing Criteria of  record Status ="InProgress"  (Different as Above)
c. Change the record Status to "Open",No Email will be triggered since it does not meet Criteria . Now change the Record status to "InProgress" again ,Now Email Will be Triggered to Owne Since ,Criteria has changed from "Not Meeting Criteria to Meeting Criteria" .(i.e Open to InProgress) 


workflow actions :

Now you have completed setting up the rule, Next step is you require to setup the  workflow actions that the rule will trigger. On the detail page for your rule, there is a section called ‘Workflow Actions’clicking Edit, and then Add Workflow Action, will present you with a dropdown menu of the actions available.
There are Four Workflow Actions present in the Salesforce :
1.New Task 
2.New Email Alert 
3.New Field Update 
4.New Outbound Message(This will be used to send soap messages with field values to an endpoint configured with your org)

Use case: 

When new account record created into the database with Active field to Yes , we require to send email notification to the record's owner .


Step 1 :Create new Workflow rule as shown below:

   a.Provide Rule Name
   b.Provide Rule Criteria as 'Active' field to Yes
   c.Select Evaluation Criteria
   d.Save the Rule







Step 2: Create Workflow Actions:

     a.Click Add Workflow actions
     b.From the dropdown select 'New Email Alert'
     c.Provide the values like shown below .









Whenever new account created with Active field 'Yes' ,An email will be triggered to Account Owner.

We hope your clear with the process now .

If you still require further clarifications,Please let us know in the comments .

Happy Learning☺☺☺


No comments:

Post a Comment