Customize global option sets

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Typically, you use global option sets to set fields so that different fields can share the same set of options, which are maintained in one location. You can reuse global option sets. You will also see them used in request parameters in a manner similar to an enumeration.

When you define an option value by using OptionMetadata, we recommend that you let the system assign a value. You do this by passing a null value when you create the new OptionMetadata instance. When you define an option, it will contain an option value prefix specific to the context of the publisher set for the solution that the option set is created in. This prefix helps reduce the chance of creating duplicate option sets for a managed solution, and in any option sets that are defined in organizations where your managed solution is installed. For more information, see Merge option set options.

The following sample shows how to retrieve a global option set by name using the RetrieveOptionSetRequest message:

No code example is currently available or this language may not be supported.

Use the CreateOptionSetRequest message to create a new global option set. Set the IsGlobal property to true to indicate that the option set is global. The following code example creates a global option set called “Example Option Set”:

No code example is currently available or this language may not be supported.

The following sample shows how to create a picklist attribute that uses a global option set by using CreateAttributeRequest:

No code example is currently available or this language may not be supported.

The following sample shows how to update the label for a global option set by using UpdateOptionSetRequest:

No code example is currently available or this language may not be supported.

The following sample shows how the options in a global option set can be ordered by using OrderOptionRequest:

No code example is currently available or this language may not be supported.

The following sample shows how to retrieve all global option sets by using RetrieveAllOptionSetsRequest:

No code example is currently available or this language may not be supported.

The following sample shows how to check whether a global option set is being used by another solution component by using RetrieveDependentComponentsRequest, and then how to delete it by using DeleteOptionSetRequest:

No code example is currently available or this language may not be supported.

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

ADD
Show: