Workflows

Automated Action:
Many of the tasks you normally assign, the emails you regularly send, and other record updates are part of your organization's standard processes. Instead of doing this work manually, you can configure workflow to do it automatically.

What is Workflow?
Workflow automates the following types of actions based on your organization's processes:
Tasks—Assign a new task to a user, role, or record owner.
Email Alerts—Send an email to one or more recipients you specify.
Field Updates—Update the value of a field on a record.
Outbound Messages—Send a secure, configurable API message (in XML format) to a designated listener.

For example, workflow can:
Assign follow-up tasks to a support rep one week after a case is updated.
Send sales management an email alert when a sales rep qualifies a large deal.
Change the Owner field on a contract three days before it expires.
Trigger an outbound API message to an external HR system to initiate the reimbursement process for an approved expense report.

Steps to Create a Workflow Rule:
 Setup
    |
    |---> Build
                |-----> Create
                        |------> Workflows & Approvals
                                               |------------>WorkflowRules
                                                                                |--------> New

1.Select the object to which this workflow rule applies. 

Enter the name, description, and criteria to trigger your workflow rule.In the next step, associate workflow actions with this workflow rule.

2. enter the rule details and Criteria
=> Enter the Rule Name
=> Choose the Evaluation Criteria
=> Create the workflow rule
Evaluate the rule when a record is:
1.created
2.created, and every time it’s edited (Information
You cannot add time-dependent workflow actions with this option.)
3.created, and any time it’s edited to subsequently meet criteria

Run this rule if the following : Criteria are met
            Formula Evaluates to true

3. Define the Actions that need to be performed whether criteria is met
Workflow Actions
Immediate Workflow Actions
Time-Dependent Workflow Actions
Each workflow rule consists of:
Criteria that cause the workflow rule to run.
Immediate actions that execute when a record matches the criteria. For example, Salesforce can automatically send an email that notifies the account team when a new high-value opportunity is created.
Time-dependent actions that queue when a record matches the criteria, and execute according to time triggers. For example, Salesforce can automatically send an email reminder to the account team if a high-value opportunity is still open ten days before the close date.

You cannot add time-dependent workflow actions because your evaluation criteria is "Every time a record is created or edited".


Created: If you choose this evaluation criteria , whenever a new record is created automatically it verifies the workflow rule.

Created, and every time it's edited: If you choose this option, whenever a new record is created or existing record is modified then it checks the workflow rule.

Created, and any time it's edited subsequently meet criteria: If you select this option whenever a new record is created or any one of the existing record which is not meeting the criteria when it is modified it will check the workflow rule.

Creation of task: Whenever the criteria is met we can perform the any actions, from actions select task. Assign a new task to a user, or role, or record owner.
 To create a task profile, should have view and setup configuration and customization permission application
Any custom object on which you want to create task should  have allow activities permission

Field Updates: Whenever the workflow rules are met we can perform an action of field update. We can update fields of the Object on which we have created workflow rule and its a parent object fields.
Re-evaluate Workflow Rules after Field Change : If you enable this option if there is any field update because of  the workflow rule it will recheck the workflow rules which are not net the condition.
Always all the workflow rules are verified first.
After verifying all the workflow rules which are meeting the condition there actions are performed according to the creation date.
The order in which field update actions are created in the same order action can be performed

i. Field update actions accouter before email alerts, task and outbound messages.
ii. Field level updates are implemented from the field level security
iii. You can't make a field as required field if there is a field update on field which will set the value.
iv. You can't delete field or object if there are any active workflow rules.
v. If there is a workflow created by the user then we can't deactivate the user

Email alerts: Whenever the workflow rule is met if you want to send a email alert to specified resiptence we use email alert action.
Note: Per day user can send thousand email alerts. Organization can send 20,00,000 emails which includes workflow email alerts, approval process email alerts, flows email alerts, rest api email alerts

Outbound Message: whenever rule is met it can the transfer the date from sf to external system. Which we called it as outbound message. To send the outbound message we need end point URL provide by the external system.
Copy that end point Url and select the list of fields which need to be a transfer to the external system.
The end point url provided by the external system should be added as remote site setting.
We can send 10 outbound messages for a single workflow rule.
We can send 10 field updates for a single workflow rule
We can created 10 immediate tasks for a single Workflow rule.


Time-Dependent Workflow Actions:

This Action will be performed at given time frame.
We can't create time dependent workflow actions when you choose the evaluation criteria is "Every time a record is created or edited".
We can create 10 time triggers on a single workflow rule on every time trigger we can add upto 40 actions.
out of 40 actions 10 email alerts, 10 field updates, 10 outbound messages, and 10 task creation.
Time based workflow actions can be tested using time based workflow queue or by adding the user to the debug and create a test record.
Salesforce evaluates time-based workflow on the organization’s time zone, not the user’s. Users in different time zones might see differences in behavior
Salesforce doesn’t necessarily execute time triggers in the order they appear on the workflow rule detail page. Workflow rules list time triggers that use the Before field first, followed by time triggers that use the After field.
Limitations:
Time triggers don’t support minutes or seconds.
Time triggers can’t reference the following:
DATE or DATETIME fields containing automatically derived functions, such as TODAY or NOW.
Formula fields that include related-object merge fields.
You also can’t add or remove time triggers if:
The workflow rule is active.
The workflow rule is deactivated, but has pending actions in the queue.
The workflow rule evaluation criteria is set to Evaluate the rule when a record is: created, and every time it’s edited.
The workflow rule is included in a package


Comments

Post a Comment

Popular posts from this blog

Page Layouts

SOQL Scenario-1