locked
XRMServicetoolkit doesn't work with retrieving record from XML RRS feed

  • Question

  • Hi All

    I am trying to retrieve data from fetch xml using  XRMServicetoolkit 

     I am getting error.[XRMServicetoolkit .Fetch:No entity node in the provided fetch XML.]

    this is mu test code

    var fetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
                 "<entity name='account'>" +
                  "<attribute name='name'/>" +            
                  "<filter type='and'>" +
                    "<filter type='or'>" +
                   "<condition attribute='xxxx' operator='eq' value='" + xxx + "'/>" +
                  "<condition attribute='xxxxx' operator='eq' value='" + xxxx + "' />" +
                   "</filter>" +
                   "</filter>" +
                  "</entity>" +
                  "</fetchXML>";
                 var result=XrmServiceToolkit.Soap.Fetch(fetchXML); 

    Does anyone have faced this issue before. Thanks in advance.

    Friday, January 6, 2017 7:53 AM

Answers

  • the fetchxml syntax you wrote is wrong, you open with <fetch> but you are closing with </fetchXML>

    I'm also not so sure about the double filter type you have, I suggest to create your query using advanced find first and download the xml from there, after you adapt it for xrmservicetoolkit


    My blog: www.crmanswers.net - CRM Theme Generator

    Friday, January 6, 2017 12:23 PM

All replies

  • the fetchxml syntax you wrote is wrong, you open with <fetch> but you are closing with </fetchXML>

    I'm also not so sure about the double filter type you have, I suggest to create your query using advanced find first and download the xml from there, after you adapt it for xrmservicetoolkit


    My blog: www.crmanswers.net - CRM Theme Generator

    Friday, January 6, 2017 12:23 PM
  • Hi Sir,

    Thank you sir ...

    Now I am able to fetch records....

    Friday, January 6, 2017 12:57 PM