Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Invalid FetchXML

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,085 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,085 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

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans