Codes and Values

We have clients that use a lot of codes in their day to day activity.

Eg: Take a look at the UK Government Common Basic Dataset: https://www.gov.uk/government/publications/common-basic-data-set-cbds-database

In this there are “codesets” corresponding to what might initially appear to be picklist or multiselect options.

At data entry point the data might be coded (Eg ‘H0038’ identifies ‘St. Martins College’. But in Salesforce I’d like to show the user what this code actually corresponded to. The user might also want to see the code, just for a confirmation feeling.

So what would be a good mechanism to bind code values to string descriptor values, so the user can interact with both?

Dependent picklists with one to one matching?

A brand new object (eg ‘Institution__c’) with records reflecting each of the possible values?

A Custom setting?

Answer

You can always use custom objects to form a code/friendly-name pairing. Just make a lookup field to the custom object, and configure it to allow searching/filtering by both name and a custom field, and you’ll have an intuitive edit mode. Follow this up with the lookup field hover feature, and they can hover over the code in a detail view to see the related information. This might not always be useful, but this is an out-of-the-box solution where you don’t need to write any code at all (configuration only!), and gives you additional reporting/viewing capabilities as well.

Attribution
Source : Link , Question Author : powlo , Answer Author : sfdcfox

Leave a Comment