Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Retrieving Records in CRM after Logging in using AJAX jQuery

$
0
0

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???


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>