Michael Philip's Blog

Writing about MS Tech with strong focus on Azure & CRM

How To : Check if an Entity can be the Primary Entity in a One-To-Many Relationship in Microsoft Dynamics CRM 2011 Using .NET

Leave a comment

The following code shows how you can check if 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;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s