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)

Fetch xml in javascript

(0) ShareShare
ReportReport
Posted on by

Hi guyzz..

         I am a beginner in Crm . I have two Entites  player and domestic ....I just want to retrieve record from domestic to player.. I just want to do this with Fetch Xml.. or query expression.. Can any one help me out....

*This post is locked for comments

I have the same question (0)
  • Rajkumar Rajaraman Profile Picture
    on at

    Is this what you are looking for?:

    lakshmanindian.wordpress.com/.../retrieve-data-using-fetchxml-with-multiple-link-entities-in-crm-2011

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Mathuraman,

    Use OData query in JavaScript instead of fetch-xml query if possible. Because, fetch-xml requires parsing.

    You can refer the following links -

    - community.dynamics.com/.../146472

    - msdn.microsoft.com/.../gg334279.aspx

    - msdn.microsoft.com/.../gg334427.aspx

    - missdynamicscrm.blogspot.in/.../tips-and-trick-odata-crm-2011-2013.html

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    If you are looking for the FetchXML you can try : https://fxb.codeplex.com/ it will help you to get fetchXML and then you can simply use it with SOAP request. Check below post it will help you to implement your requirement:

    arunpotti.wordpress.com/.../retrieve-records-using-fetch-xml-java-script-in-crm-201113

  • Community Member Profile Picture
    on at

    hii... I have tried this code.. but I am unable to get the values it is giving error as undefined.

    function contactOnload()

    {

    debugger;

    var contactFetchXML="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+

    "  <entity name='ccs_playerinternational'>"+

    "    <attribute name='ccs_playerinternationalid' />"+

    "    <attribute name='ccs_name' />"+

    "    <attribute name='createdon' />"+

    "    <order attribute='ccs_name' descending='false' />"+

    "    <filter type='and'>"+

    "      <condition attribute='ccs_name' operator='eq' value='Dravid' />"+

    "    </filter>"+

    "  </entity>"+

    "</fetch>";

    var contactRecords = XrmServiceToolkit.Soap.Fetch(contactFetchXML);

    alert("sfv");

    if (contactRecords.length > 0) {

    alert(contactRecords[0].attributes.ccs_noofmatches.value);

    if(contactRecords[0].attributes.ccs_fifties.value!= undefined)

    alert(contactRecords[0].attributes.ccs_name.value);

    }

    }

  • Aileen Gusni Profile Picture
    44,524 on at

    Muthuraman,

    You can try using advanced find to generate the fetch xml for learning

    Just go to adv find, query as per your want then click result, then download the fetch xml.

    nycrmdev.blogspot.sg/.../using-advanced-find-fetchxml-capability.html

    Thanks

  • suresh maurya Profile Picture
    630 on at

    For testing of FetchXML, you can test here online http://msxrmtools.com

  • Irakliy Profile Picture
    15 on at

    Hello!

    There is one more way to retrive records you want by fetch.

    You can use MS CRM js library:

    retrieveMultiple: function (fetchXML, onSuccess) {

           Xrm.Internal.messages.retrieveMultiple(fetchXML).then(function (response) {

               entityCollection = response.get_entityCollection().get_entities();

               onSuccess(entityCollection);

           }, Mscrm.InternalUtilities.ClientApiUtility.actionFailedCallback);

       }

    I'm using this, because it's really easy to use, and retrived records can be easy access for values:

    $(entityCollection).each(function (i, col) {

                   var table = $("<table>").attr("id", col.get_key());-id record

                   col.getValue("fieldname") - attributeValue

    ....

    I know this unsupport, BUT i really don't like REST requests, or send fetch via GET request.

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