RetrieveRelationshipRequest RetrieveRelationshipRequest RetrieveRelationshipRequest RetrieveRelationshipRequest Class

Definition

Contains the data that is needed to retrieve entity relationship metadata.

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

Examples

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.

//Retrieve the One-to-many relationship using the MetadataId.
RetrieveRelationshipRequest retrieveOneToManyRequest =
    new RetrieveRelationshipRequest { MetadataId = _oneToManyRelationshipId };

RetrieveRelationshipResponse retrieveOneToManyResponse = (RetrieveRelationshipResponse)svc.Execute(retrieveOneToManyRequest); Console.WriteLine("Retrieved {0} One-to-many relationship by id", retrieveOneToManyResponse.RelationshipMetadata.SchemaName);

//Retrieve the Many-to-many relationship using the Name. RetrieveRelationshipRequest retrieveManyToManyRequest = new RetrieveRelationshipRequest { Name = _manyToManyRelationshipName};

RetrieveRelationshipResponse retrieveManyToManyResponse = (RetrieveRelationshipResponse)svc.Execute(retrieveManyToManyRequest); Console.WriteLine("Retrieved {0} Many-to-Many relationship by Name", retrieveManyToManyResponse.RelationshipMetadata.MetadataId);

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.

relationships#WorkWithRelationships.RetrieveRelationship relationshipsVB#WorkWithRelationships.RetrieveRelationship

Remarks

Message Availability

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

Usage

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

Privileges and Access Rights

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

Notes for Callers

You can use either the Name or the MetadataId of the relationship.

Constructors

RetrieveRelationshipRequest() RetrieveRelationshipRequest() RetrieveRelationshipRequest() RetrieveRelationshipRequest()

Initializes a new instance of the RetrieveRelationshipRequest class

Properties

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)
MetadataId MetadataId MetadataId MetadataId

Gets or sets the MetadataId of the RelationshipMetadataBase to be retrieved. Optional.

Name Name Name Name

Gets or sets the unique name for the entity relationship to be retrieved. Optional.

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