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

Announcements

No record found.

News and Announcements icon
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,985 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 130 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 117

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans