Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

MS CRM 2015 web API to get GUID using telepone1

Posted on by Microsoft Employee

I am new to MS CRM 2015. I am trying to get guid using the telephone1 but i have not found any web api as we have in 2016. In MS CRM 2016 i am using the following APi to get the contact idhttp://CRMURL/api/data/v8.0/contacts?$select=telephone1&$filter=telephone1%20eq%20%279091%27

it is working with 2016 but same api is not working with MS 2015. anyone of you please help me to identify the equivalent api in 2015 to get contact id. I am using on-premises CRM. Thanks in advance.

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    Hi ,

    You can also refer below url-

    m.youtube.com/watch

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    For CRM Rest Builder, just download the solution and install it in your CRM environment.

    It is pretty straight forward.

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    This would be the Url that you would be using:

    crmurl/.../ContactSet$select=ContactId&$filter=Telephone1 eq '(800)%20555-1212'

    You can query it in JavaScript as below:

    var req = new XMLHttpRequest();

    req.open("GET", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/OrganizationData.svc/ContactSet?$select=ContactId&$filter=Telephone1 eq '(800)%20555-1212'", true);

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

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

    req.onreadystatechange = function() {

       if (this.readyState === 4) {

           this.onreadystatechange = null;

           if (this.status === 200) {

               var returned = JSON.parse(this.responseText).d;

               var results = returned.results;

               for (var i = 0; i < results.length; i++) {

                   var contactId = results[i].ContactId;

               }

           } else {

               Xrm.Utility.alertDialog(this.statusText);

           }

       }

    };

    req.send();

    You will need to make sure that you add the SDK.REST.js web resource to the form where you want to call this from. Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    Thank you Levin for response. I am sorry i am new with CRM i want to know who can i use this Builder for create the query. (GUID using telephone1). Thanks in advance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    Thank you for your response. Could you please guide me how can i use Odata. I was using java in 2016 to get the guid now how i get GUID using odata by java.? Thanks in advance.

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    You should download CRM Rest Builder.

    That will help you with building Web API (2016) or Rest Calls (2011-2015) in order to query Dynamics CRM using the OData Service

    github.com/.../CRMRESTBuilder

    You can easily create the correct query and copy the JavaScript to run it. This works for both Online and On-Premise deployments.

    Hope this helps.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: MS CRM 2015 web API to get GUID using telepone1

    Hi,

    Unfortunately Dynamics  CRM 2015 does not support WEB API , you can use odata query using organization data service.

    Please refer below -

    msdn.microsoft.com/.../gg334767(v=crm.7).aspx

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans