Define A Workflow Rules
What is Workflow?
Using Workflow you can automates the following types of actions based on your organization’s processes:
- Tasks— this action is used to assign a new task to a user, role, or record owner.
- Email Alerts— this action is used to send an email to one or more recipients as you specify.
- Field Updates— this action is used to update the value of a field on a record.
- Outbound Messages— this action is used to send a secure, configurable API (Application Programming Interface) message (in XML) to a designated listener.
How to create a workflow?
We can automate our organization’s standard processes by configuring workflow rules.
To create a new rule:
- Select an object to which the workflow rule applies.
- Configure the workflow rule settings and its criteria.
- Configure the workflow actions.
- Once you done with creation of workflow, do not forget to activate the workflow rule.
How workflow works internally?
Workflow basically works in two phases and Phases are as below :
- Rule Criteria i.e. define your criteria on which you want to execute your workflow.
- Action Perform i.e. what action you want to perform like once your defined criteria returned as “True” such as Field updates, Email alerts, Tasks and Outbound messages.
Pictorial representation of Workflow:
Phase 1. Rule Criteria
In this section we are creating Workflow rules and set the criteria for when workflow rules get fire. For creating this please follow the below steps
Step 1. Create > workflow & Approvals > Workflow Rules and click New button
In Lightning Experience , Setup > Process Automation > Workflow Rules > Workflow Rules and click New Rule button
Step 2. Select the object on which you want apply workflow (e.g. here we are choosing Line Item object) and click Next button
Step 3. Fill the Rule Name, Select the Evaluation Criteria (e.g. here we are choosing “created, and every time it’s edited”) and set Rule criteria (This rule criteria defines whether your workflow action will fire or not, if your specified criteria got met then your specified action will fire otherwise your action will not fire e.g. here we set our criteria is, if Line Item stock not equal to null then perform the action) and click Save & Next button
Till here we are done with workflow rules defination. Now we are moving to second phase i.e. Action Perform
Phase 2. Action Perform
In this section we are defining the action, means if our criteria got met then action will perform. Actions are :
1. Field Update
2. New task
3. Email send
4. Outbound Messages
Here we use New Field Update as an action, click done button
After Clicking on Done Button, below screen will appear where you need to fill the Name, and Unique Name and field to update and specify value (e.g. here we are upadating Merchandise’s stock field with the remaining stock after selling from the line Item, by using formula to set the new value to Merchandise’s stock) and click Save button.
Note : once you have created your workflow, please don’t forget to Activate it, using Activate Button on next screen.