web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

fetchxml query returns 0 records

(0) ShareShare
ReportReport
Posted on by 515

Hello,

I want to show data from dynamics 365 on portal page, I am following article here - https://www.iotap.com/blog/entryid/414/default

I have created web template like below code:

{% fetchxml mobileSize %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" returntotalrecordcount="true" page="1" >
  <entity name="new_mobile" >
    <attribute name="new_size" />
  </entity>
</fetch>
{% endfetchxml %}
{  
  {% if mobileSize.results.total_record_count != 0 %}
  "value": [{
    {% for item in mobileSize.results.entities %}
      "size": item.size
      {% unless forloop.last %},{% endunless %}
    {% endfor %}
    }]
   {% else %}
   "value": []
   {% endif %}
}


but I am getting 

mobileSize.results.total_record_count = 0

Even if there is 5 record matching the fetchxml query. see below image (I have confirmed with xrmtoolbox)

fx.png

I am not able to figure out what I am missing. does anybody faced this situation?

Regards,
Ashish

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Tino Rabe Profile Picture
    652 on at

    Hi,

    did you enable Entity Permissions for the queried entity and assigned those Entity Permissions to the Web Role of your Portal user (i.e. CRM contact)??

  • Ashish Moradiya Profile Picture
    515 on at

    Perfect!

    Thanks Tino

  • Community Member Profile Picture
    on at

    EDIT: Defunct Post

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans