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:
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”:
The following sample shows how to create a picklist attribute that uses a global option set by using CreateAttributeRequest:
The following sample shows how to update the label for a global option set by using UpdateOptionSetRequest:
The following sample shows how the options in a global option set can be ordered by using OrderOptionRequest:
The following sample shows how to retrieve all global option sets by using RetrieveAllOptionSetsRequest:
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:
Customize Microsoft Dynamics 365 applications
Use the Organization service with Dynamics 365 metadata
Insert, update, delete, and order global option set options
Global option set messages
Global option set metadata values
Sample: Create a global option set
Sample: Work with global option sets
Sample: Dump global option set information to a file
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright