Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

how to parse values from XrmServiceToolkit.Soap.Fetch ?

Posted on by 235

I m doing XrmServiceToolkit.Soap.Fetch request in web resource and it is returning a result:

Query

  

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
  <entity name="productpricelevel" >
    <attribute name="productpricelevelid" />
    <filter type="and" >
      <condition attribute="productpricelevelid" operator="eq" value="D1E5EFE3-F48B-DE11-A931-005056C00008" />
    </filter>
    <link-entity name="product" from="productid" to="productid" >
      <attribute name="name" />
      <attribute name="price" />
    </link-entity>
  </entity>
</fetch>

Results (in FetchXmlTest tool)

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
    <entity name="productpricelevel" >
        <attribute name="productpricelevelid" />
        <filter type="and" >
            <condition attribute="productpricelevelid" operator="eq" value="D1E5EFE3-F48B-DE11-A931-005056C00008" />
        </filter>
        <link-entity name="product" from="productid" to="productid" >
            <attribute name="name" />
            <attribute name="price" />
        </link-entity>
    </entity>
</fetch>

Can you please guide how I can read values from results ? I need to save these values into JS variables.

 

Kindly help

*This post is locked for comments

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: how to parse values from XrmServiceToolkit.Soap.Fetch ?

    Hi,

    Try the following code.

    var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);
    if (contactRecords.length > 0) {
     if (contactRecords[0].attributes.telephone1 != undefined)
       alert(contactRecords[0].attributes.telephone1.value);
      }
    }

    For more details, refer the blog below.

    https://arunpotti.wordpress.com/2014/11/15/retrieve-records-using-fetch-xml-java-script-in-crm-201113/

  • umma Profile Picture
    umma 235 on at
    RE: how to parse values from XrmServiceToolkit.Soap.Fetch ?

    can anyone guide please

  • umma Profile Picture
    umma 235 on at
    RE: how to parse values from XrmServiceToolkit.Soap.Fetch ?

    bump

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans