Dynamically Required Picklists

Although Salesforce does not fully support dynamically required fields, you can use the dependent picklist feature from the Winter ’06 release to implement this functionality when the field to be required is a picklist field and it’s requirement-rule is based upon another single picklist (or checkbox) field. To illustrate, the following requirement is common for many sales organizations and can use dependent picklists to fulfill it.

Require the end user to select a Reason Lost when the Opportunity Stage is set to ‘Closed Lost’

The steps to accomplish this are:

  1. Create a custom picklist field called ‘Reason Lost’ on the Opportunity Object.
  2. After creating the field, add a Field Dependency with the Stage as the controlling field.
  3. Add Stage as a Controlling Field

  4. Associate all of the Reason Lost values with the Closed Lost controlling value.
  5. Add Reason Lost as the Controlling Value

  6. Add the Reason Lost field to the Page Layout and require that field.
  7. You are already finished!

Here it is in action. While the Stage is set to values with no corresponding Reason Lost values, the Reason Lost field is read-only and is not required. Once the Stage is changed to Closed Lost, the Reason Lost field becomes read-write and is required.

Reason Lost is now required when stage is Closed Lost

8 Comments

  1. Chris Said,

    March 23, 2006 @ 9:15 pm

    Why not go one step further, and have one consolidated “Reason Won/Lost field” that has different values dependent on if the Stage is Closed Won or Closed Lost? Still required, but more value for the real estate on the page…

  2. Successforce Blog Said,

    March 27, 2006 @ 3:54 pm

    Dynamically Required Picklists to Capture…

    There have been some really interesting best practice ideas emerging from customer and partner blogs. This week Scott Hemmeter wrote about how you could use dependent picklists to create dynamically required picklists. The example he used was a field

  3. Jamie Said,

    March 29, 2006 @ 11:52 am

    Any ideas on how I could create an “action” dependency? I’m trying to create a calendar event when a status field is set to “confirmed”

  4. Scott Hemmeter Said,

    March 29, 2006 @ 12:20 pm

    Re: Jamie’s question:

    Any ideas on how I could create an “action” dependency? I’m trying to create a calendar event when a status field is set to “confirmed”

    You need to do this using Salesforce’s Workflow module, not dependent picklists. The catch is that you cannot create a Calendar event. You can only create a Task. The Task will have a date associated to it, but will only be visible in the Task list on the homepage, not the Calendar.

    Go into your Help link in Salesforce and search on “Managing Workflow”. You will need to read more about Creating a Workflow Rule and Creating a Workflow Task.

  5. Matthew Bennett Said,

    September 8, 2006 @ 11:36 am

    Thanks, Scott, that has worked just fine for me. Nice explanation.

  6. Francis Said,

    October 1, 2009 @ 2:31 am

    Dear All

    I want a to create a Pickliat as READ ONLY. And assign a default value to it.
    How to do it.
    Thanks in advance

  7. Chris A. Said,

    February 15, 2012 @ 3:36 pm

    Are there updated instructions like this for newer versions of SFDC? My company is using SFDC 12. What’s described here probably will work in new versions, but I’m a newbie, and want to be sure.

  8. Scott Hemmeter Said,

    February 15, 2012 @ 4:16 pm

    @Chris A, this was written in 2006. Not sure the difference now off hand.

RSS feed for comments on this post