April 9, 2013
Challenge
You want to use standard out-of-the-box Salesforce functionality to have specific fields appear on a page layout based on some conditional logic, but you don’t want to have to deal with writing VisualForce pages or Apex classes or triggers.
Who Can Use This?
Unlimited Edition, Enterprise Edition, and Professional Edition (with Workflow enabled)
Use Cases
A common use case would be to have a “Reason Opportunity Lost” note field appear for any Closed Lost opportunity. Granted you could use dependent picklists, but what if you need more detail than what a picklist can provide and want to use a Text or Text Area field to capture notes about why the Opportunity was lost?
Perhaps you collect only limited information about a Lead and want to display more fields as the Lead is qualified at each step of your Lead qualification process.
Or let’s say you have a guided selling methodology and you want to utilize a wizard-style pattern for navigation. Each navigation step would relate to a step in your selling process, only displaying the fields related to that stage of the sales cycle.
Our Approach
We have been using a little trick for creating navigation wizard patterns for a number of years that involves Record Types, Page Layouts, and Workflow Rules with Field Updates. The basic idea is that if a field on a record contains a value that you want to use to “trigger” the next step in the process and display different fields on the page, you can setup a workflow rule to “listen” for that event and change the value of the Record Type for that record to one that has a Page Layout assignment that contains the fields that correspond to the next “step” in the navigation wizard.
Begin With the End in Mind
If a wizard-based navigation pattern is the right solution for what you are trying to achieve, what should it look like? Sketch out the process end-to-end and ask yourself:
- How many steps will my process have? Hint – keep it simple, using as few steps as absolutely necessary to minimize the ongoing maintenance requirements.
- What information needs to be collected at each step of the process?
- What are the “triggers” that move the process from one step to the next?
Implementation
Once you have your design fleshed out, it is time to implement the solution.
Page Layouts
The first thing you want to do is establish Page Layouts for each step in the process. Be sure to give these Page Layouts descriptive names so that you can easily determine which step of your process they support, but don’t “hard code” specific step numbers or use any nomenclature that will force you to have to go back and rename the entire lot if you want to add or remove steps somewhere down the line.

Salesforce Page Layout
For information that is required for a given stage in your process, be sure to make the corresponding fields on the Page Layout ‘Required’. This is especially true if you have a specific field that you will be watching in the Workflow Rule to move the process forward to the next step in the navigation wizard.
Conversely, if you do not want certain information changed after it has been submitted, mark those fields on the Page Layout for subsequent stages in the process as ‘Read Only.’

Salesforce Page Layout Field Options
Record Types
After you have your Page Layouts established, you want to create new Record Types for each step. An important thing to note here is that since you probably don’t want your users to access these Record Types directly and circumvent the navigation wizard, only grant the System Administrator Profile access. Limiting this access will not prevent you from building the navigation wizard. Another item to note is that you probably do not want to make any of the Record Types that you are creating for the navigation wizard to be the default for any Profiles, as inactivating and deleting them later will require additional steps to accomplish.
It should go without saying, but for each new Record Type that you create in support of a step in the navigation wizard, make sure you mark the Record Type as ‘Active’ or it will not be available to use.

Salesforce Record Types
After you have completed Step 1 of the Record Type setup, you have the ability to assign Page Layouts to this Record Type. This is a critical step as it creates the link between a step in a process and the fields that get displayed on the screen when a User has reached that step. Once the Page Layout assignment is complete, you can save this new Record Type and move on to the next one.

Salesforce Record Type: Assign Page Layouts
Workflow Rules
Now comes the fun part. Create a new Workflow Rule for the same Object that you created the Page Layouts and Record Types for, and give it a name and description that describes the corresponding step in the navigation wizard.
For the Evaluation Criteria, since we want to create a “listener” on a specific field or fields for the record in context, we want to select either “created, and any time it’s edited to subsequently meet criteria” or “created, and every time it’s edited” to ensure that Salesforce takes a look at the record to make a decision as to whether it is ready to move on to the next stage in the navigation wizard. We are going to assume that you know enough about Workflow Rules to understand the difference between the two options and will make a decision as to which is more appropriate for your specific application, but in general you want to make sure that you select options that will not cause conflicts or create false dependencies within your process.
For the Rule Criteria, you need to define the specific condition under which the Workflow Rule will fire. For example, if you are designing a navigation wizard for your Lead qualification process, you will probably want to look at either the Lead Status field itself and set your filter to evaluate whether the Lead Status field equals a specific value or values, or you will want to evaluate any number of fields that underly your qualification process to determine if all of them together evaluate to a True condition.
In the ‘Specify Workflow Actions’ step, you want to select an Immediate Workflow Action of type ‘New Field Update’ (or ‘Select Existing Action’ if you have already created this Workflow Action). Give your Field Update a descriptive name, make sure the Object is set to the correct Salesforce Object in context, and for the ‘Field to Update,’ select the [Object Name] Record Type. For example, “Account Record Type.”
As for whether you set ‘Re-evaluate Workflow Rules after Field Change’ to True or False, again this is something that you need to determine based on how this step in the navigation wizard affects previous or subsequent steps in the process. Under the ‘Specify New Field Value’ section, select the Record Type that represents the next step in your navigation wizard.

Salesforce Workflow Action – Field Update
After you complete all of these steps and are taken back to the Detail page for your new Workflow Rule, all you have to do is activate it. If you want to wait until all of the other rules are in before you do any activation, don’t forget to remember to go back and activate your rules before testing, otherwise you will pull your hair out and curse this blog post wondering why nothing is working.
What Does it Look Like?
Once you have completed all of these steps, the next thing to do is test your shiny new navigation wizard. Simply create and save a new record for the object that you created the wizard for (log in as a User with a Profile other than System Administrator to test out whether fields are Read Only in Page Layouts or if the navigation wizard will only be employed by specific profiles). Now edit the record and change the value of the field or fields that “trigger” moving on to the next step of the process, then save it – does the Page Layout change? If so, congratulations – the first step works! If not, go back and start your troubleshooting at the Workflow Rule level and work backwards.
Once you have been able to complete the wizard end-to-end, go back and try to break it…throw any outliers you can come up with at it and see where the process breaks down. If you find that you can’t break it, great! Now it’s time to get your stakeholders involved for User Acceptance Testing. Thumbs up from the stakeholders? Awesome, check this project off your list and go enjoy a beverage!
Have any questions or feedback? Please post a comment below to join the discussion.