Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Dynamics Portal FetchXML returns empty

Posted on by 105

Hello,

I'm executing a fetch XML query in the liquid code, my XML is correct but it always returns empty

could you please help?

Here is my code

{% fetchxml MyFetchSearch %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" count="1" returntotalrecordcount="true" page="1" >
  <entity name="new_entity">
     <attribute name="new_entityname" />
    <filter type="and">
       <condition attribute="new_entityattribute" value="1" operator="eq"/>
    </filter>
  </entity>
</fetch>
{% endfetchxml %}{ 
  "Result" : "{{MyFetchSearch }}"
}

Thank you

*This post is locked for comments

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Dynamics Portal FetchXML returns empty

    Hi,

    In advanced find look for "new_entity",select "new_entityname" in view and use condition "new_entityattribute" equals 1. If it returns any rows then download fetchxml from advanced find and use it in your code.

    If still you face issue then check that current user has privilege to read "new_entity" or not.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics Portal FetchXML returns empty
    Have you tried something along the lines of:

    {% for res in MyFetchSearch.results.entities %}
    {{ res.fieldname1 }}
    {{ res.fieldname2 }}
    ...
    {% endfor %}
  • Suggested answer
    Arpit Shrivastava Profile Picture
    Arpit Shrivastava 7,518 User Group Leader on at
    RE: Dynamics Portal FetchXML returns empty

    Please make sure you have enabled the proper Entity Permissions on the entity (new_entity).

    If found useful, please mark the answer as verified.

    Cheers

    Arpit

    arpitmscrmhunt.blogspot.com

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics Portal FetchXML returns empty

    Hello,

    are you confirm your condition is correct or not?

    <filter type="and">

          <condition attribute="new_entityattribute" value="1" operator="eq"/>

       </filter>

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans