13 Mar 2016

workflow rules in salesforce

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 rules to do it automatically.
Workflow rules can help automate 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 rules 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.
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.com 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.com can automatically send an email reminder to the account team if a high-value opportunity is still open ten days before the close date.
Navigation====>>>

Setup--->Build--->Create---->Workflow rule&Approval---->Workflow rule--->New

Step1--->Select the object to which this workflow rule applies---->Next
Step2--->Rule name ,Description and Criteria
Step3---->Save and Next--->Done
Workflow Considerations:
Each workflow rule applies to a single object.
  • If you have workflow rules on converted leads and want to use cross-object field updates on the resulting accounts and opportunities, you must enable the lead setting Enable Validation and Triggers from Lead Convert.
  • Workflow rules on custom objects are automatically deleted if the custom object is deleted.
  • The order in which individual actions and types of actions are executed is not guaranteed. However, field update actions are executed first, followed by other actions.
  • To create workflow rules that update case fields based on new case comments or incoming email messages, choose Case Comment or Email Message from the Select Object drop-down list; Email Message is only available if Email-to-Case orOn-Demand Email-to-Case is enabled. You can only create email message workflow rules for field updates, and case comment workflow rules for field updates, email alerts, and outbound messages. For example, you can create a workflow rule so that an email marked as Is Incoming changes its case's Status from Closed to New.
  • Changes you make to records while using Connect Offline are evaluated by workflow rules when you synchronize.
  • Salesforce processes rules in the following order:
  1. Validation rules
  1. Assignment rules
  1. Auto-response rules
  1. Workflow rules (with immediate actions)
  1. Escalation rules
  • If a lookup field references a record that has been deleted, Salesforce clears the value of the lookup field by default. Alternatively, you can choose to prevent records from being deleted if they’re in a lookup relationship.
When Do Workflow Rules Get Triggered?
  • Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. However, rules created after saving records aren't triggered by those records retroactively.
  • Workflow rules are triggered when a standard object in a master-detail relationship is re-parented, even if the object's evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria.
  • Saving or creating records can trigger more than one rule.
  • Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your organization.
  • Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for approval.
  • If your organization uses multiple languages, enter filter values in your individual language. You can add up to 25 filter criteria, of up to 255 characters each.
  • If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated label value won’t trigger the workflow rule. Workflow criteria evaluate the master label value and ignore the translated value. To avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the Value field.
  • Workflow rules can't be triggered by campaign statistic fields, including individual campaign statistics and campaign hierarchy statistics.
  • The following actions don't trigger workflow rules.
  • Mass replacing picklist values
  • Mass updating address fields
  • Mass updating divisions
  • Changing the territory assignments of accounts and opportunities
  • Converting leads to person accounts
  • Deactivating Self-Service Portal, Customer Portal, or Partner Portal users
  • Converting state and country data from the State and Country Picklists page in Setup
  • Making changes to state and country picklists using AddressSettings in the Metadata API
Workflow Rule Limitations
  • You can't package workflow rules with time triggers.
  • You can't create outbound messages for workflow rules on junction objects.

  • If you create workflow rules to replace any Apex triggers, make sure you delete those Apex triggers when you activate the equivalent workflow rules. Otherwise, both Apex triggers and workflow rules will fire and cause unexpected results, such as overwritten field updates or redundant email messages.
  • When you use picklists to specify filter criteria, the selected values are stored in the organization's default language. If you edit or clone existing filter criteria, first set the Default Language on the Company Information page to the same language that was used to set the original filter criteria. Otherwise, the filter criteria may not be evaluated as expected.