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)

Portal: Liquid undefined functions on Customer Self-Service demo

(1) ShareShare
ReportReport
Posted on by 12

Hi everyone,

I setup a Customer Self-Service demo portal in order to enhance the knowledge on CRM Portal customization. Running over all the site functionalities I encountered some undocumented behaviours of the portal. If  you have the possibility to access the demo I am talking about the Home of the WebSite (for those who cannot access the demo code I will cut and paste some WebTemplate LIQUID code). There are 3 sections on the Home WebPage which are related to the CRM KnowledgeArticle standard entity:

1. Most Popular Articles

2. Most Recent Articles

3. Top Rated Articles

these 3 sections are rendered each through a specific LIQUID WebTemplate, for each section this is the piece of code I would like to focus:

 1. Most Popular Articles --> {% assign popular_articles = knowledge.articles | popular: count,languagecode  %}

 2. Most Recent Articles --> {% assign recent_articles = knowledge.articles | recent: count,languagecode  %}

 3. Top Rated Articles --> {% assign top_articles = knowledge.articles | top: count,languagecode  %}

The undefined behavior are:

- Where is the knowledge class defined? I mean, on CRM there is an entity "knowledgearticles" but I didn't find a place for an association with the class "knowledge". LIQUID does not specify an object "knowledge" and the liquid reference (https://www.microsoft.com/en-us/dynamics/crm-setup-and-administration/entities.aspx) define a standard way to access an entity content i.e. "entities.account"

- Assuming  knowledge.articles is the list of knowledgearticles stored on the CRM, its content is filtered through a specific function respectively : popular, recent, top. Neither of this function is defined in LIQUID, furthermore it seems there is no way to define custom functions. So my second question is, where are this functions defined? Is it possible to define custom functions for a generic entity?

Hope to finde some answer. 

Thanks in Advance,

Paolo

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Paolo,

    thanks for your questions: I'm interested to those topics too. Waiting for answers from more experienced people.

  • Verified answer
    Colin V Profile Picture
    on at

    Hi, these are undocumented liquid objects and filters so that is why it is seeming a little mysterious right now.

    knowledge is a predefined liquid object just like there is one for forums.  knowledge.articles is a attribute of the knowledge object which is an array of knowledgearticles.

    "|top: count,language" or "| recent: count,language" are filters applied to the knowledge.articles array which sort the array by the fields count and languagecode.

    These objects and filters are not accessible to you to modify, and you do not have the ability to build your own because they would need to be part of the web site code which you don't have access to.

    With the other liquid objects, filters, and tags though you can rebuild the knowledge object yourself with the entities object which will return single entity records by ID or with the fetchxml object which allows you to make fetchxml queries and return a list or array of entity records.  You could then iterate through that result set with the forloop object and output as you desire them.

    Take a read through the Dynamics 365 portals administrator guide and specifically the liquid template section.  There is also the old Adxstudio Community site documentation which will be very similar.

    community.adxstudio.com/.../liquid-templates

    I am doing some blog posts on liquid templates as well if those help - colinvermander.com/.../liquid-templates

    Colin

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