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)

Invalid FetchXML

(0) ShareShare
ReportReport
Posted on by 850

Hi Guys..

Need you help

What is the error in below code

" < fetch version = '1.0' output - format = 'xml-platform' mapping = 'logical' distinct = 'false' > "+
"<entity name='new_customer'>" +
"<attribute name='new_customerid' />" +
"<attribute name='new_name' />" +
"<attribute name='createdon' />" +
"<attribute name='new_producttype' />" +
"<filter type='and'>" +
"<condition attribute='new_customerid' operator='eq' value='{9FFD192D-8A47-E811-A959-000D3AF2242B}' />" +
"</filter>" +
"</entity>" +
"</fetch>" ;

The Error Is showing Inavlid FetchXML

*This post is locked for comments

I have the same question (0)
  • Iswarya Profile Picture
    1,347 on at

    Hi,

    try this

               var Fetch = " < fetch version = '1.0' output - format = 'xml-platform' mapping = 'logical' distinct = 'false' > " +

    "<entity name='new_customer'>" +

    "<attribute name='new_customerid' />" +

    "<attribute name='new_name' />" +

    "<attribute name='createdon' />" +

    "<attribute name='new_producttype' />" +

    "<filter type='and'>" +

    "<condition attribute='new_customerid' operator='eq' value='{9FFD192D-8A47-E811-A959-000D3AF2242B}' />" +

    "</filter>" +

    "</entity>" +

    "</fetch>";

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hello Nazir,

    Removed some spaces , not sure  its seems correct  - 

    Try with this  -

    "<fetch version ='1.0' output-format ='xml-platform' mapping='logical' distinct='false' > "+
    "<entity name='new_customer'>" +
    "<attribute name='new_customerid' />" +
    "<attribute name='new_name' />" +
    "<attribute name='createdon' />" +
    "<attribute name='new_producttype' />" +
    "<filter type='and'>" +
    "<condition attribute='new_customerid' operator='eq' value='{9FFD192D-8A47-E811-A959-000D3AF2242B}' />" +
    "</filter>" +
    "</entity>" +
    "</fetch>" ;


  • gdas Profile Picture
    50,091 Moderator on at

    In addition make sure the attributes name are correct , and try to prepare the FetchXML using advance find .

  • Suggested answer
    Justinjose Profile Picture
    2,707 on at

    Hi naZir,

    try following code

    var fetchXml = $@"<fetch version ='1.0' output-format ='xml-platform' mapping='logical' distinct='false' > "+
    "<entity name='new_customer'>" +
    "<attribute name='new_customerid' />" +
    "<attribute name='new_name' />" +
    "<attribute name='createdon' />" +
    "<attribute name='new_producttype' />" +
    "<filter type='and'>" +
    "<condition attribute='new_customerid' operator='eq' value='{9FFD192D-8A47-E811-A959-000D3AF2242B}' />" +
    "</filter>" +
    "</entity>" +
    "</fetch>" ;

    Thanks

    Justin Jose

  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Please rebuild your FetchXml from the Advanced Find Query.

    Or download the XRM Toolbox and use the 'FetchXML Builder' plugin to build, execute and copy/format the FetchXML.

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