Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to display Regarding(objectid) in the view for notes entity?

Posted on by Microsoft Employee

We are using Notes entity view to display in Portal. How to show Regarding(objectid) in the view.

*This post is locked for comments

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    Dmytro Rutkovskyi 1,835 on at
    RE: How to display Regarding(objectid) in the view for notes entity?

    At least you can use liquid templates to render entity list in way you need.

    Below some example of Task entity and regarding fields:

    {% fetchxml mytasks %} 
    <fetch count="10" returntotalrecordcount="true" >
      <entity name="task" >
        <attribute name="modifiedon" />
        <attribute name="scheduledend" />
        <attribute name="subject" />
        <attribute name="regardingobjectid" />
        <attribute name="activityid" />
        <order attribute="modifiedon" descending="true" />
      </entity>
    </fetch>
    {% endfetchxml %}
     <div class="panel-heading"> <span class="panel-title"><a href="/mytasks"><span class="label label-primary">My Tasks</span> <span class="badge">{{mytasks.results.total_record_count}}</span></a></span></div>
    {% if mytasks.results.entities.size > 0 %}
    <table class="table table-condensed table-striped">
    <thead><tr><th>Subject</th><th>Date Due</th><th>Regarding</th></tr></thead>
    <tbody>
    {% for item in mytasks.results.entities %}
      <tr>
    <td> <a href="mytasks/mytasks-edit/?id={{ item.activityid }}">{{ item.subject }}</a></td>
    <td> {{ item.scheduledend }} </td>
    <td>
    {% case item.regardingobjectid.logicalname %}
    {% when 'incident' %}
       <a href="/support/edit-case/?id={{ item.regardingobjectid.id }}"><span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> {{ item.regardingobjectid.name }}</a></td> 
    {% when 'contact' %}
      <a href="/support/edit-contact/?id={{ item.regardingobjectid.id }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> {{ item.regardingobjectid.name }}</a></td> 
    {% when 'account' %}
      <a href="/customers/customer/?id={{ item.regardingobjectid.id }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> {{ item.regardingobjectid.name }}</a></td> 
    {% else %}
      {{ item.regardingobjectid.name }}
    {% endcase %}
    </td>
    </tr>
    {% endfor -%}
    </tbody>
    </table>
    {% else %}
    <div class="panel-body">There are no tasks</div>
    {% endif %}


  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 4,052 on at
    RE: How to display Regarding(objectid) in the view for notes entity?

    We can't add the object id into the notes view

    Are your note records always attached to the same entity ? you could add a field for any other entity directly related to the notes entity (this might make sense if it is always the same entity)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans