You have no doubt seen a picklist in action—one of those drop-down lists that provide a selection of valid values. The Force.com platform picklist data type allows you to specify the values for the picklist and displays the object in the appropriate user interface.
There are several places in your application that cry out for picklists to guide your users to correct data values.
In the Position object, these fields require only a limited set of values:
Department - departments in Universal Containers
Education - levels of educational attainment
Status - progress of the position towards being filled
The Candidate object also has an opportunity for a picklist
Education -specifies the maximum level of education for this candidate
In addition to these basic picklists, which will limit the user selection to a single value from a list of values, the Position object also contains a different type of picklist, one that limits the selection of values for a user, but allows the user to select more than one value. You can use this type of functionality for a picklist that lists all the programming languages required for a particular technical position.
As you might have noticed when defining fields in the previous chapters, the picklist option is available as a data type for fields.
The picklists look just as you had hoped. The Candidate object could use a picklist, but since you already understand how to use the Field Creation Wizard to make picklists, you can just follow the instructions in the Code Share project for this book to add the Education picklist to the Candidate object, since you will need that picklist to define a formula field later in this chapter. The Education picklist has the same values as the Educational Requirements picklist for the Position object.
Voice of the Developer
You can edit picklists while the field is in production, but you should be aware of the potential implications of this action. If you delete a picklist value, existing records with fields containing this value will be unaffected. The platform does not invalidate the data entries so that you can later decide what value should take its place in these records. You can replace the value with the Replace link next to a given picklist field. If you choose to edit a pick list value, the platform will update existing records with the new value for you; however, if you have written Apex code (covered in Chapters 10 and 11) that references this value, the code will not be modified, which, depending on the implementation, can potentially cause run-time errors. For this reason, best practices suggest careful consideration of picklist values before releasing any applications into the wild. |
3.133.158.36