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 :
Microsoft Dynamics CRM (Archived)

View with a common field from two different entities

(0) ShareShare
ReportReport
Posted on by

I have two entities 'Account' and 'Contact', each has a property 'Region'. I have a custom view where I display the Appointments for Account or Contact with no meeting notes attached. In this view, all the fields are from Appointments entity. Now  I have to display the region as well. Depending upon entity, it can either be from Account or Contact. How can I put it as a single field in the view. Any suggestion is appreciated . Thank you

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    KZee Profile Picture
    on at

    If your custom view is querying both account and contact (as linked / related entities to appointment) and both are returning region then you will get two region columns one from each entity but each column will be unique because of the alias used for the entity.

    Don't think so there is any out of the box way to show only one of those two columns.

    Following link might be usedful.

    msdn.microsoft.com/.../gg328457.aspx

  • Community Member Profile Picture
    on at

    Thank you for your reply. Additional Information that might be little helpful is contact also has Account information, as related entity. Is there way to consolidate just from contact entity itself , so only one column can be displayed but then the region can be either from Contact's region or Contact's regarding Account region.Thanks again.

  • Suggested answer
    KZee Profile Picture
    on at

    So, you are looking to go Appointments->Contact->Account.

    FetchXml does allow doing this because it will be using a unique alias each for Contact and Account but CRM Advance Find / View Designer would not allow you to pick columns from a related entity two levels down. It will show you columns only from Appointments and all related entities of Appointment not from related entities of Contact.

    Following is an example of incident->Contact->Account. Executing this in the code will return columns from incident entity, ac.createdon and ae.createdon but CRM view / advance find would not allow to pick ae.createdon.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">

     <entity name="incident">

       <attribute name="title" />

       <attribute name="ticketnumber" />

       <attribute name="createdon" />    

       <attribute name="incidentid" />

       <order attribute="title" descending="false" />

       <link-entity name="contact" from="contactid" to="customerid" alias="ac">

         <attribute name="createdon" />

         <link-entity name="account" from="primarycontactid" to="contactid" alias="ae">

           <attribute name="createdon" />

         </link-entity>

       </link-entity>

     </entity>

    </fetch>

    I hope this answers the question.

    Pls mark the answer as verified if it was 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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans