Tuesday, March 13, 2012

MSCRM 2011: Using Option Sets

One of the most useful additions to Microsoft Dynamics CRM 2011 are Global Option Sets. Option Sets provide an easy way to create what in CRM 4.0 we referred to as “pick lists” (and now call “option sets”) and make them available for any entity in the system. In Microsoft Dynamics CRM 4.0, we had to manually synchronize pick lists across multiple entities. Global Option Sets will save you time and the pick list will only need to be created one time. This allows for consistent design.

For example: Suppose you use the CRM sales entities leads and opportunities along with contacts and accounts. And suppose you’ve got a custom pick list on the lead form and you want to carry the selected value through the entire sales process: first as the lead is created, then the opportunity and then finally the account and contact. It can be done very easily the first time around: add the field to each of the four entities with the same list of values, and then map the field from lead to opportunity, lead to contact and lead to account…But then, you decide you need to change the values in the pick list…so you change them in all four places…manually…and then another change needs to be made.

This situation is where the value of global option sets is shown. With them, you create an Option Set once, and then simply point to it for the values of a field on any entity in the system. If you need to change its values, you change them in one place and they show up everywhere it’s used.

Let’s assume there is a list for product interest values on leads and opportunities, where you want the same option set on the forms for all record types.

To create a global option set in CRM 2011:
*In the site map, click Settings, and then in the Customization
group, click Customizations.
* On the Customization page, click Customize
the System.
* In the Components section of left navigation,
click Option Sets.
* On the Option Sets toolbar, click New.
* Supply an appropriate name for the option set, and then use the Options section at the bottom of the Option Set window to add values, just as you would a regular option set.
* When you’ve got your values entered, click Save & Close in the Option Set window. Then click Publish on the toolbar to publish out your new option set.

Once created, the option set can be used on any entity.
Below, is an example that adds the Option Set to the Leads form.
*In the site map, click Sales, and then click Leads.
*Click the Customize tab on the ribbon.
*In the Design group on the Customize tab, click Form. The form editor opens.
*At the right-hand side of the form editor is the new Field Explorer. At the very bottom is the New Field button; click that to create a new field.
*In the new field form, supply an appropriate value in Display Name, and use the default value for Name or change it as you’d like, along with any of the other options.
*In the Type section, select Option Set in the Type drop-down list.
* Select Yes for the Use Existing Option Set field.
* Then you can select the option set created previously in the Option Set drop-down list
* You can select a default value or use the “Unassigned Value” option.
* Then click Save and Close.

The new option set will now be available in the Field Explorer, so locate it and drag & drop it on the form where you would like it to be displayed.

No comments: