
Better UX with Dependent Picklists: Required Fields Done Right
Ever needed a field to be required—but only sometimes?
We ran into a common UX challenge while configuring a Salesforce record page:
✅ We needed a field on the Case object to be required,
❌ but only when the Status field was set to Closed.
Requiring it at the field level wasn’t going to work—it would force users to fill it out no matter what the Status was. Not helpful, and definitely not a great experience.
In our case, when the Case.Status picklist field was set to Closed, we wanted to require a custon Closed Reason field have a value. But for statuses like New or Working, the Closed Reason field should be totally optional (or even hidden).
We wanted a way to:
- Prevent users from skipping the Closed Reason when closing something
- Avoid annoying them with an irrelevant field for other statuses
- Keep the logic in configuration (no Apex triggers or custom validations)
Turns out, the combination of two things made this really smooth:
-
Dependent Picklists
We made our custom Closed Reason field dependent on the Status picklist. It was only enabled when Status = Closed.
-
Page Layout Requirement
We set Closed Reason as required on the page layout, not at the field level.
The magic of this solution is: when the controlling field (Status) isn’t set to Closed, the Closed Reason field is disabled—so the required setting is gracefully bypassed. But when Status is Closed, the field is enabled and it’s required. 👨🍳
How to Set Up a Dependent Picklist
This makes sure the Closed Reason field only appears when Status = Closed.
- Go to Setup → Object Manager → select your object (e.g., Case or Opportunity).
- Click Fields & Relationships.
- Click the Field Dependencies button.
- Click New to create a new dependency.
- For Controlling Field, select Status.
- For Dependent Field, select Closed Reason.

- Click Save.
- In the matrix that appears, check the box for the value Closed under the Status column, and select the applicable values for Closed Reason that should be available when Status = Closed.

- Save the dependency.
👉 Result: Closed Reason only appears when Status = Closed.
How to Make the Field Required on the Page Layout
This ensures the field is only required when it’s enabled (i.e., when Status is Closed).
- Still in Object Manager, go to the Page Layouts section for your object.
- Open the layout where the field appears (e.g., Case Layout).
- Find the Closed Reason field on the layout.
- Click the wrench icon (🔧) or double-click the field.
- Check the Required checkbox.

- Click OK, then Save the layout.
👉 Important: Do not mark the field required at the field-level definition—only on the layout.
Why This Works So Well
This setup:
- Keeps users focused only on the fields they need to see
- Avoids conditional validation rules (and their maintenance headaches)
- Gives you a low-code, maintainable UX pattern that scales across similar scenarios
It’s small. But it’s mighty.
