RetrieveDependentComponentsRequest Class

Definition

Contains the data that is needed to retrieves a list dependencies for solution components that directly depend on a solution component.

For the Web API use the RetrieveDependentComponents Function.

public ref class RetrieveDependentComponentsRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class RetrieveDependentComponentsRequest : Microsoft.Xrm.Sdk.OrganizationRequest
type RetrieveDependentComponentsRequest = class
    inherit OrganizationRequest
Public NotInheritable Class RetrieveDependentComponentsRequest
Inherits OrganizationRequest
Inheritance
RetrieveDependentComponentsRequest
Attributes

Examples


// Create the request to see which components have a dependency on the
// global option set.

var dependencyRequest =
    new RetrieveDependentComponentsRequest
    {
        ObjectId = _optionSetId,
        ComponentType = (int)componenttype.OptionSet
    };

    var dependencyResponse =
    (RetrieveDependentComponentsResponse)svc.Execute(
    dependencyRequest);

// Here you would check the dependencyResponse.EntityCollection property
// and act as appropriate. However, we know there is exactly one 
// dependency so this example deals with it directly and deletes 
// the previously created attribute.

var deleteAttributeRequest =
    new DeleteAttributeRequest
{
    EntityLogicalName = Contact.EntityLogicalName,
    LogicalName = "sample_examplepicklist"
};
   svc.Execute(deleteAttributeRequest);
Console.WriteLine("Referring attribute deleted.");
      #endregion How to delete attribute

#region How to delete global option set
// Finally, delete the global option set. Attempting this before deleting
// the picklist above will result in an exception being thrown.

var deleteRequest = new DeleteOptionSetRequest
{
    Name = _globalOptionSetName
};
svc.Execute(deleteRequest);

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. For the complete sample, see the link later in this topic.

optionsets#WorkwithGlobalOptionSets12 optionsetsVB#WorkwithGlobalOptionSets12

Remarks

Message Availability

For this message to work, the caller must be connected to the server.

Usage

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

Privileges and Access Rights

To perform this action, the caller must have the required privileges, as listed in RetrieveDependentComponents message privileges.

Constructors

RetrieveDependentComponentsRequest()

Initializes a new instance of the RetrieveDependentComponentsRequest class.

Properties

ComponentType

Gets or sets the value that represents the solution component. Required.

ExtensionData

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

(Inherited from OrganizationRequest)
Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
ObjectId

Gets or sets the ID of the solution component that you want to check. Required.

Parameters

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

(Inherited from OrganizationRequest)
RequestId

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

(Inherited from OrganizationRequest)
RequestName

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

(Inherited from OrganizationRequest)

Applies to