Skip to main content

Notifications

Announcements

No record found.

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

  • Suggested answer
    Shidin Haridas Profile Picture
    Shidin Haridas 3,497 on at
    RE: Invalid FetchXML

    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.

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: Invalid FetchXML

    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

  • gdas Profile Picture
    gdas 50,087 on at
    RE: Invalid FetchXML

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

  • Verified answer
    gdas Profile Picture
    gdas 50,087 on at
    RE: Invalid FetchXML

    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>" ;


  • Iswarya Profile Picture
    Iswarya 1,345 on at
    RE: Invalid FetchXML

    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>";

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,514 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans