Making the Account field a strict option list
By Kyle Hatlestad on Feb 08, 2010
But in this person's particular case, they wanted users to stick to the strict list of defined Accounts and not be able to deviate from that by adding additional suffix parameters to the Account (for example).
With a custom component, this can certainly be accomplished. But with some creative use of Rules, this can be done with just configuration. And I'm always in favor of configuration over customization.
The first step is to create a new custom metadata field. You can name it Account (xAccount) or similar value. Check the 'Enable Option List' and Configure. For the Option List Type, select 'Select List Validated'. This will make it a strict option list. Check the 'Use view' radio button and select 'Document Accounts' from the list.
Update the database design to add the new field and rebuild the search index (if necessary).
Now create a new Rule. You can make it a global rule if you always want it to take effect or apply it to your specific Profiles. Go to the Fields tab and add the Account field (the system one, not the new one just created). It should be directly under Security Group. Change its Type to 'Hidden'. Then click the 'Is derived field' check box and click the Edit button. Go to the Custom tab and click the Custom check box. Add this line of code:
xAccount will be for whatever you named your custom metadata field.
OK the new Rule. Apply the rule to your Profiles (if not global) and position the field if desired.Now we have our strict list Account field! We're basically controlling the display with our custom field and using the Rule to keep it in synch with the system's Account field.