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)

Retrieving Records in CRM after Logging in using AJAX jQuery

(0) ShareShare
ReportReport
Posted on by

I can successfully reach XRMServices on ORGANIZATION_URL/XRMServices/2011/OrganizationData.svc/AccountSet?$select=AccountNumber and retrieve customer account number on a browser after logging in. However, there is an authentication service blocking this if I use AJAX. My code is as below

$$.ajax({
                type: "GET",
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                url: ORGANIZATION_URL+ "/XRMServices/2011/OrganizationData.svc/AccountSet?$select=AccountNumber,Telephone1,Telephone2,new_CustomerDiscGroup,EMailAddress1,EMailAddress2,EMailAddress3",
                beforeSend: function (XMLHttpRequest) {
                    XMLHttpRequest.setRequestHeader("Accept", "application/json");
                    console.log(XMLHttpRequest);
                },
                complete: function (XmlHttpRequest) {
                    console.log(XMLHttpRequest);
                },
                success: function (data, textStatus, XmlHttpRequest) {
                    console.log(data);
                },
                error: function (XmlHttpRequest, textStatus, errorThrown) {
                    console.log(textStatus);
                }
            });


What am I missing???

*This post is locked for comments

I have the same question (0)
  • ashlega Profile Picture
    34,477 on at

    Hi,

     did you try to debug the script to see what exactly you are passing to that url parameter for the ajax call? Are you able to open exactly the same url? (not by typing it in manually, but by "copy-pasting" from the script debugger window, for example)

  • Community Member Profile Picture
    on at

    I did do that. I just can't get through on Ajax. How does one pass CRM Dynamics credentials probably is what I'm not getting

  • Suggested answer
    Dynamics_Alok Profile Picture
    1,746 on at

    REST call for Dynamics CRM is only limited to CRM webresources .If you have some other requirement then go with Web API.

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