function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Will ColleyWill Colley 

how do I make a field use picklist values only?

I want to make a field use the picklist values only.  It has a button on the right that shows the picklist values, but the user can enter anything.
Best Answer chosen by Will Colley
William TranWilliam Tran
Will,  

unless you have a Visual force page, validation rule is the best way to proceed.

You can use this VR as a template (this is out of the box, you need to change the values if you modify the OOTB subjects):

AND(
Subject <> "Call",
Subject <> "Email",
Subject <> "Send Letter",
Subject <> "Send Quote",
Subject <> "Other")


The VR is located at Setup/Build/Customize/Activities/Task Validation Rules

Error location is Field: Subject 
Error message: Please choose one of the pre-defined subject

Thx.

All Answers

William TranWilliam Tran
Can you elaborate? is this a normal pagelayout or a VF page.  Do you have access to the list (or are you to expecting to dynamically enforce the value to match the list but the list values could change)?

Thx.
Will ColleyWill Colley
Specifically, it is the "Subject" field in Log a Call/New Task.  I want my team to select from a pre-set drop down (picklist) so that we can track their activity more specifically.  I have the picklist set.  However, Salesforce allows any response.  In fact, the picklist is only visible if you click the button to the right.  

Thanks for your help!
 
Chris MarzellaChris Marzella
You would need to use a validation rule on this field to not allow any value other than your piclist values.
Chris MarzellaChris Marzella
This should work:
NOT(OR( Subject = "New", Subject = "Old", Subject = "Rejected"))
William TranWilliam Tran
Will,  

unless you have a Visual force page, validation rule is the best way to proceed.

You can use this VR as a template (this is out of the box, you need to change the values if you modify the OOTB subjects):

AND(
Subject <> "Call",
Subject <> "Email",
Subject <> "Send Letter",
Subject <> "Send Quote",
Subject <> "Other")


The VR is located at Setup/Build/Customize/Activities/Task Validation Rules

Error location is Field: Subject 
Error message: Please choose one of the pre-defined subject

Thx.
This was selected as the best answer
William TranWilliam Tran

Will, are you good?

If yes, please mark the question as resolved by choosing best answer (you can only choose 1 best answer).

But you can give thumbs up to any/all of the replies

Thx