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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Do anyone give simple ODATA examples

(0) ShareShare
ReportReport
Posted on by

Hi All,

I want to practice ODATA will you please share some good examples for beginners to learn . It will be helpful for me .

Thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jason M. Cosman Profile Picture
    5,234 Moderator on at
  • Suggested answer
    necsa Profile Picture
    3,455 on at
    RE: Do anyone give simple ODATA examples

    Hi Dynamics Surya,

    You can use also tool for ODATA download from following link DynamicsXRMTools2015 and import as solution. You can get also information from download page

    dynamicsxrmtools.codeplex.com/releases

  • Verified answer
    nghieppham Profile Picture
    4,755 on at
    RE: Do anyone give simple ODATA examples

    Hello Dynamics Surya,

    You can download the CRM Restbuilder crmrestbuilder.codeplex.com

    and then generate OData for testing.

    Regards

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Do anyone give simple ODATA examples

    GetAccount: function (accountId, successCallback, errorCallback) {

       //OData URI to get address information from parent account record

       var oDataURI = Xrm.Page.context.getClientUrl()

           + "/XRMServices/2011/OrganizationData.svc/"

           + "AccountSet(guid'" + accountId + "')"

           + "?$select="

           + "Address1_City,"

           + "Address1_Country,"

           + "Address1_Line1,"

           + "Address1_Line2,"

           + "Address1_Line3,"

           + "Address1_StateOrProvince,"

           + "Address1_PostalCode";

       //Asynchronous XMLHttpRequest to retrieve account record

       var req = new XMLHttpRequest();

       req.open("GET", encodeURI(oDataURI), true);

       req.setRequestHeader("Accept", "application/json");

       req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

       req.onreadystatechange = function () {

           //debugger;

           if (this.readyState == 4 /* complete */) {

               req.onreadystatechange = null; //avoids memory leaks

               if (this.status == 200) {

                   //parse the response string as a JSON object into the successCallback method.

                   successCallback(JSON.parse(this.responseText).d);

               }

               else {

                   errorCallback(accountId);

               }

           }

       };

       req.send();

    },

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Do anyone give simple ODATA examples

    My friend download SDK, it has sample code which should help you, if you have any doubt you can post your query here.

    Thanks

  • Gabe Kressel Profile Picture
    20 on at
    RE: Do anyone give simple ODATA examples

    If you have a test cloud app account or a relational database, you can practice in creating OData endpoints using Skyvia webtool. The list of connectors it supports can be found here: https://skyvia.com/connect/

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans