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 not giving any records when used on Portal.

(0) ShareShare
ReportReport
Posted on by 480

Hi,

I am facing a strange problem with CRM Portal. I have a fetchxml query which when run in Fetchxml Tester gives me 5 records. But when I use it in CRM Portals in Liquid.

It does not give me any results.

Query is below which gives me 5 records in Fetch testing tool but does not give any record when used in Portals

{% fetchxml my_query %}
   <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="new_invoice">   
    <attribute name="new_totalamountdue" />
    <attribute name="new_invoicenumber" />
    <attribute name="new_invoicedate" /> 
    <order attribute="new_vendor" descending="false" />
    <filter type="and">
      <condition attribute="new_invoicedate" operator="last-month" />
      <condition attribute="statecode" operator="eq" value="0" />
    </filter>    
  </entity>
</fetch>
{% endfetchxml %}

In portals when I check the result size/count  below give me "0":-

{{ my_query.results.entities.size }}

If someone has an idea of what is wrong, please help me.

(If I relax the filters in fetchxml query e.g. remove conditions, then it works @CRM portal shows records)

*This post is locked for comments

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Arif,

    The logged in user should have permissions to the records which may be returned by fetch i.e. if fetch can return 5 records but the logged in user doesn't have permission for those 5 records then it will show the results as 0.

    Make sure the entity permissions are configured correctly for your entity.

    docs.microsoft.com/.../assign-entity-permissions

  • Verified answer
    Syed Ibrahim Profile Picture
    6,257 on at

    As Ravi suggested, it should be because of the user permission when you render any custom entity or OOB entity on your web page using query, the portal user who has the assigned roles should have permission to the entity which you are trying to show. By default portal users have "authenticated users" role. Try to give permission to that for the entity which you are displaying on the portal.

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