Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

D365 Portals - Display Attributes of an Entity Object

(0) ShareShare
ReportReport
Posted on by

Hello,

I am attempting to do something that I thought was rather simple but is not working as expected.  I would like to display a field value of a custom entity record on the web page.   I am using the following in my web template:

{% assign application = entities['new_appliction'][request.params.id] %}

{% if application %}
<div style="background:white; padding-left:10px;"><h3><strong>{{application.name}}</strong></h3></div>
{% endif %}

Seems straightforward to me, however nothing is displayed.

I've added {{ request.params.id }} to validate that the id of the record is being returned.  I then used that ID to validate that the record exists in Dynamics.  I've also confirmed the name of the entity and the name of the field.

So it appears that the application entity is not being created therefore the if logic is failing.

Interestingly, if I use the same code (modified for entity), I am able to return and display values from out of the box entities such as Account.  For example:

  {% assign account = entities['account'][request.params.id] %}
  {% if account.id %}
	<div style="background:white; padding-left:10px;"><h3><strong>{{account.name}}</strong></h3></div>
  {% endif %}

I assume this works on custom entities??    Any insight that you can provide is appreciated

Tom

*This post is locked for comments

  • Suggested answer
    Nicholas Hayduk Profile Picture
    Nicholas Hayduk 2,863 on at
    RE: D365 Portals - Display Attributes of an Entity Object

    Hi Tom,

    Have you configured Entity Permissions for the new_application entity?  Liquid code enforces entity permissions, so even if the record exists, you won't see anything if the user doesn't have the correct permissions.

    Nick

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: D365 Portals - Display Attributes of an Entity Object

    Hi Tom,

    The code/script you have used is correct I still believe that it has to do with some schema name or some id issues. I noticed that you are using "new_appliction" while getting the entities, is this the correct schema name (missing "a" in new_application?

    Hope this helps.

  • Tom Thompson Profile Picture
    Tom Thompson on at
    RE: D365 Portals - Display Attributes of an Entity Object

    Hi Ravi,

    Thanks for the reply.  However, I am indeed using the correct publisher for this field in the code.  I should have indicated that in my original post.

    Tom

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: D365 Portals - Display Attributes of an Entity Object

    Hi,

    This may be because you are using .name which is the scham name of the account's name field. Application being a custom entity should have some prefix like new_name etc. Basically you get the field values by using the schema name of the field. account.name works because name is the schema name of the "Account Name" field.

    Hope this helps.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans