Showing posts with label Creating Workflow Rules. Show all posts
Showing posts with label Creating Workflow Rules. Show all posts

Thursday, November 29, 2012

New Task option for Add Workflow Action in Force.com is missing

One of the workflow actions that we can set up in Force.com platform is a task assignment. So, you have a new custom object and you are setting up workflow rules for this object. You want to add a new task for workflow action. However, on the 3rd step of creating workflow rule, you do not see 'New Task' option under 'Add Workflow Action'. So, what are you missing?

When creating the custom object, there was an optional feature called 'Allow Activities'. You probably did not check that option. Go to the Edit page for your custom object and scroll down. You will see a section called 'Optional Features'.



Check 'Allow Activities', save and add workflow action now. The 'New Task' option will be available.

Happy cloud computing using Salesforce!

Tuesday, November 27, 2012

Understanding Workflow Rule criteria in Force.com

In the article Creating Workflow Rules we learnt the steps involved in creating workflow rules in Force.com platform. In this article let us explore the step of defining the rule criteria. 

In Step 2 while creating the workflow rule, after you enter the rule name and description, you have 2 sections - Evaluation Criteria and Rule criteria as shown below. 



They both work together to determine when the rule is executed. Let us go in the reverse direction. First let us see what is Rule Criteria and then Evaluation Criteria.

Rule Criteria - Rule Criteria defines when to trigger the rule. You can define this based on the combination of field values or based on a formula evaluation. 

Let us take a very simple example to understand this better. 


  • Say you have an object called Invoice with a field named Status of values 'Open' and 'Closed'. 
  • You want to perform some action when the status of each invoice record is closed.
  •  You would define the rule criteria as 'Status' equals 'Closed'. 
This defines the criteria to trigger the rule when status is changed to closed for invoice record. However it is not that straight forward. As we can see below the evaluation criteria controls this further.

Evaluation Criteria - This defines when to evaluate the rule criteria. Only when this criteria is met, the rule criteria is evaluated and triggered if met.  There are 3 different choices.

  • created - This indicates evaluate the rule criteria each time a record is created. That means rule is evaluated only once when record is created. Hence in our example this option would indicate each time when an Invoice record is created, since evaluation criteria is met, rule criteria is evaluated and hence checked if the Invoice is created with 'Closed' status. If it is not created with 'Closed' status, no action is performed. Rule is never triggered again for this record even if the invoice changes to 'Closed' later on.
  • created, and every time it's edited - This indicates evaluate the rule criteria each time a record is created and updated. Hence in our example this option would check if the Invoice status is 'Closed' when a record is created as well as each time the record is updated.
  • created, and any time it's edited to subsequently meet criteria - This is same as the above but the difference is it makes sure when the record is updated the rule criteria is really met as part of the update. In other words, it ignores the record edits that are not relevant to the rule criteria. In our example, say Invoice Status is updated from 'Open' to 'Closed' -  Rule criteria is evaluated and triggered since status was changed to 'Closed'. Now say Invoice record is updated again to correct the customer address zip code - Rule criteria is not evaluated though the Invoice status is 'Closed'. Platform will understand that the update is not related to the status change.
That is how we set the rule criteria. On this step there is one more item which is part of rule criteria called 'Add Filter Logic'. We will cover this in the next article.

Happy cloud computing using Salesforce!

Monday, November 26, 2012

Creating Workflow Rules in Force.com

In one of our previous articles we learnt what is Workflow and Approval Process in Force.com platform and how it is important for any organization. We also learnt that workflow is made up of Workflow Rules. 

Workflow rules define rules for workflow step. It defines the criteria, the schedule and the execution plan for the workflow actions. In this article let us explore how to create those rules using the Force.com platform.

To create a workflow rule go to App Setup -> Create -> Workflow and Approvals -> Workflow Rules. Then click on the 'New Rule' button.


Step 1 - You select the object to which your workflow rule applies. Each rule applies to a single object
Step 2 - You enter the rule name and description. You define the rule criteria.

Step 3 - You specify the workflow actions that will be executed when the rule criteria are met.

Save the workflow rules and activate it from the workflow rule detail page. As far as the overall steps go it is as simple as this. But both Step 2 and Step 3 are much involved. Both steps deserve an article itself to get a good understanding. Coming soon!

Happy cloud computing using Salesforce!