SBX - Search With Button

SBX - Forum Post Title

Liquid: How to get count of child entity

Microsoft Dynamics CRM Forum

Usmani asked a question on 6 Feb 2019 4:36 PM

Question Status

Verified

Just wanted to know can we get record count of child entity using Liquid in Dynamics portal. For example

{% assign account = entities.account['936DA01F-9ABD-4d9d-80C7-02AF85C822A8'] %}
{{account.new_child_entity.size}}


I am not getting any output using 

{{account.new_child_entity.size}}

or

{{account.new_child_entity[0].id}}

I can get result using fetchXML, wondering if we can do it directly using reference entity? 

Reply
Ravi Kashyap responded on 6 Feb 2019 7:00 PM
Verified Answer

Hi,

No, there is no method to get the count of child entity directly. One option which you have already explorer is to use fetchxml and retrieve the records.

Hope this helps.

Reply
Oliver Rodrigues responded on 7 Feb 2019 7:49 AM
My Badges
Suggested Answer

if you have a subgrid in your form you can count the subgrid rows:

       var rows = $("#subgrid_Children .view-grid table").find("tbody > tr");

Reply
Ravi Kashyap responded on 6 Feb 2019 7:00 PM
Verified Answer

Hi,

No, there is no method to get the count of child entity directly. One option which you have already explorer is to use fetchxml and retrieve the records.

Hope this helps.

Reply
Oliver Rodrigues responded on 7 Feb 2019 7:49 AM
My Badges
Suggested Answer

if you have a subgrid in your form you can count the subgrid rows:

       var rows = $("#subgrid_Children .view-grid table").find("tbody > tr");

Reply

SBX - Two Col Forum

SBX - Migrated JS