Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Dynamics Portal - Liquid Issues

Posted on by 40

Hi,

I'm trying to do something very easy on a page, display some values from a custom entity on a Portals web page using Liquid.

Following along various blogs I've come up with the following code to try and display Contact info.

<h2>Contact Details</h2>
<p>{% assign contactid = 'C5A9C763-A516-E811-A82D-000D3AE0CB84' %}</p>
<p>{% assign entityname = 'contact' %}</p>
<p>{% assign contact = entities[entityname][contactid] %}</p>
<div>{{ contactid }}, {{ entityname }}
<br />{{ contact.firstname }}</div>
<!-- <div>{% if contact %} CreatedOn: {{contact.createdon}} ModifiedOn: {{contact.modifiedon}} {% endif %}</div> -->

This doesn't work now but it did at one stage over the weekend.

The below code to display a custom Invoice entity record.

<h2>Invoice Details</h2>
<p>Invoice ID: {{params.id}}</p>
<p>{% assign recordid = 'D2AD1983-AC21-E811-A841-000D3AE0E65E' %}</p>
<p>{% assign entityname = 'xx_invoice' %}</p>
<p>{% assign invoice = entities[entityname][recordid] %}</p>
<div>{{ recordid }}
<br />{{ invoice.name }}</div>
<div>{% if invoice %} CreatedOn: {{invoice.createdon}} ModifiedOn: {{invoice.modifiedon}} {% endif %}</div>

This code has never worked.

I have no idea why this doesn't work.

Any help appreciated.

Categories:
  • Verified answer
    Kevin Annfield Profile Picture
    Kevin Annfield 40 on at
    RE: Dynamics Portal - Liquid Issues

    So it turns out the problem was to do with security. I needed to add an entity permission to allow users to see the page. Silly mistake!

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans