How To : Check if an Entity can be the Primary Entity in a One-To-Many Relationship in CRM Using C# SDK

The following code shows how  to can check whether an Entity can be the Primary Entity in a One-To-Many Relationship or not.

Code:

  //Create Request
  CanBeReferencedRequest Request = new CanBeReferencedRequest();

 //Set Entity Name
Request.EntityName = "account";

 //Get Response
CanBeReferencedResponse Response = (CanBeReferencedResponse)_serviceProxy.Execute(Request);

 //Get Result
var result = Response.CanBeReferenced;

Leave a Reply

Your email address will not be published. Required fields are marked *