RetrieveAllOptionSetsRequest RetrieveAllOptionSetsRequest RetrieveAllOptionSetsRequest RetrieveAllOptionSetsRequest Class


Contains the data that is needed to retrieve information about all global option sets.

public ref class RetrieveAllOptionSetsRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
public sealed class RetrieveAllOptionSetsRequest : Microsoft.Xrm.Sdk.OrganizationRequest
type RetrieveAllOptionSetsRequest = class
    inherit OrganizationRequest
Public NotInheritable Class RetrieveAllOptionSetsRequest
Inherits OrganizationRequest


The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface.

// Use RetrieveAllOptionSetsRequest to retrieve all global option sets.
// Create the request.
RetrieveAllOptionSetsRequest retrieveAllOptionSetsRequest =
    new RetrieveAllOptionSetsRequest();

// Execute the request RetrieveAllOptionSetsResponse retrieveAllOptionSetsResponse = (RetrieveAllOptionSetsResponse)svc.Execute( retrieveAllOptionSetsRequest);

// Now you can use RetrieveAllOptionSetsResponse.OptionSetMetadata property to // work with all retrieved option sets. if (retrieveAllOptionSetsResponse.OptionSetMetadata.Count() > 0) { Console.WriteLine("All the global option sets retrieved as below:"); int count = 1; foreach (OptionSetMetadataBase optionSetMetadata in retrieveAllOptionSetsResponse.OptionSetMetadata) { Console.WriteLine("{0} {1}", count++, (optionSetMetadata.DisplayName.LocalizedLabels.Count >0)? optionSetMetadata.DisplayName.LocalizedLabels[0].Label : String.Empty); } }


Message Availability

This message works regardless whether the caller is connected to the server or offline.


Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of RetrieveAllOptionSetsResponse.

Privileges and Access Rights

To perform this action, the caller must have privileges listed in RetrieveAllOptionSets message privileges.

Notes for Callers


RetrieveAllOptionSetsRequest() RetrieveAllOptionSetsRequest() RetrieveAllOptionSetsRequest() RetrieveAllOptionSetsRequest()

Initializes a new instance of the RetrieveAllOptionSetsRequest class


ExtensionData ExtensionData ExtensionData ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String] Item[String] Item[String] Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters Parameters Parameters Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId RequestId RequestId RequestId

Gets or sets the ID of an asynchronous operation (system job). Optional.

(Inherited from OrganizationRequest)
RequestName RequestName RequestName RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RetrieveAsIfPublished RetrieveAsIfPublished RetrieveAsIfPublished RetrieveAsIfPublished

Gets or sets whether to retrieve the metadata that has not been published. Required.

Applies to