web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans