web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Check for entitype of a field

(0) ShareShare
ReportReport
Posted on by 6

Hello All,

Is there anyway i could use in C#.Net code to figure out what is the entitytype of the Cutomer field.

I have the same question (0)
  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Use below code to get entitType of customer field.

    // late bound

    if (entity.Contains("customerid") && entity["customerid"] != null) {

       EntityReference customer = (EntityReference)entity["customerid"];

       Console.WriteLine("The customer type of this lead is " + customer.LogicalName);

    }

    See below article for more info.

    www.crmanswers.net/.../dynamics-crm-special-data-types.html

    Please Mark My Answer Verified If I Were Helpful

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans