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,...
Suggested Answer

Entity Metadata / Entity Type code

(0) ShareShare
ReportReport
Posted on by 200

Hi,

I'm trying to dsiplay information from appointment and other data based on the regarding object (account, opportunity, lead...). 

To make this work, I assume I shoud do a join with the medata entity and then display the needed fields . I looked for the metadata entity but it's not present. 

pastedimage1639601053861v1.png

Thanks, 

KR,

Hicham

I have the same question (0)
  • Suggested answer
    PerezAguiar Profile Picture
    Microsoft Employee on at

    Hey Hicham.

    On https://community.dynamics.com/365/f/dynamics-365-general-forum/402451/customer-guide-how-to-reduce-activitypointerbase, there's a nice query that counts records and shows if htey're appointment, etc.  Perhaps that should be your base, as it uses ActivityPointer table

    Maybe a join between Appointment and ActivityPointer table?

  • Hicham GRC Profile Picture
    200 on at

    Hi Daniel,

    Thanks for the suggestion. It's not really what I'm looking for.

    Finally, I wrote this code. 

    SELECT 
    	TOP 100
    	--regardingobjectid, 
    	--regardingobjectidname, 
    	regardingobjecttypecode,
    	appointment.subject,
    	--ActivityTypeCodeName,
    	account.ctx_easynumber 'Account number',
    	account.address1_city 'Account city',
    	opportunity.name 'Opportunity name',
    	opportunity.ctx_mainopportunityreference 'Opportunity reference',
    	lead.firstname, 
    	lead.lastname
    FROM appointment	
    LEFT JOIN account
    	ON account.accountid = appointment.regardingobjectid
    	AND appointment.regardingobjecttypecode = 1
    LEFT JOIN opportunity
    	ON opportunity.opportunityid = appointment.regardingobjectid
    	AND appointment.regardingobjecttypecode = 3
    LEFT JOIN lead
    	ON lead.leadid = appointment.regardingobjectid
    	AND  appointment.regardingobjecttypecode = 4
    WHERE 
    appointment.regardingobjectid IS NOT NULL

    Greetings, Hicham

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
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 37

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans