Share via


GetValidReferencedEntitiesRequest Class

Definition

Contains the data that is needed to retrieve a list of table logical names that are valid as the primary table (one) from the specified table in a one-to-many relationship.

public ref class GetValidReferencedEntitiesRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class GetValidReferencedEntitiesRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/xrm/2011/Contracts")>]
type GetValidReferencedEntitiesRequest = class
    inherit OrganizationRequest
Public NotInheritable Class GetValidReferencedEntitiesRequest
Inherits OrganizationRequest
Inheritance
GetValidReferencedEntitiesRequest
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 instance.

/// <summary>
/// Demonstrate GetValidReferencedEntities
/// </summary>
/// <param name="service">Authenticated IOrganizationService instance</param>
static void GetValidReferencedEntitiesExample(IOrganizationService service)
{

      GetValidReferencedEntitiesRequest request = new() { 
         ReferencingEntityName = "account"
      };

      var response = (GetValidReferencedEntitiesResponse)service.Execute(request);

      // Sort the names alphabetically
      Array.Sort(response.EntityNames);

      foreach (string tableLogicalName in response.EntityNames)
      {
         Console.WriteLine(tableLogicalName);
      }
}

Output:

aaduser
account
actioncard
activityfileattachment
activitymonitor
< truncated for brevity >

Remarks

Use this message in a user interface to enable creating new one-to-many table relationships. It only includes the names of tables that are eligible to participate as a referenced table in these kinds of relationships.

For the Web API use the GetValidReferencedEntities function.

Usage

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

Notes for Callers

If no table name is specified, this message returns all tables that can be the primary entity in a one-to-many relationship.

Constructors

GetValidReferencedEntitiesRequest()

Initializes a new instance of the GetValidReferencedEntitiesRequest class.

Properties

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

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

(Inherited from OrganizationRequest)
ReferencingEntityName

Gets or sets the table logical name to get valid referenced entities. Optional.

RequestId

Gets or sets the ID of the request. 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