Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Cannot get REST to work with JavaScript in CRM 2011

$
0
0

I'm having a lot of trouble trying to get this to work, having read the SDK etc.

I am basically trying to access the Organization Service by REST from within a form when something happens.

The URL for this service is http://myserverName/MyCrmName/XRMServices/2011/OrganizationData.svc/ (found by using Developer Resources and it resolves correctly)

In the form I have loaded SDK.REST.JS and JSON.JS from the SDK samples.

I ensure that in the SDK.REST library I have edited the getServerUrl() method to ensure it does not use the deprecated getServeUrl method but rather the getClientUrl method. Ultimately I am ensuring that this library sets up the web request with

/myserverName/MyCrmName/XRMServices/2011/OrganizationData.svc/ (if I include the "http//" I get an Access /Denied).

My code to call into the sdk.rest.retrieveMultipleRecords is

MyOrg.Cases.onRegardingFoiChanged = function () {
        SDK.REST.retrieveMultipleRecords("Account","$select=Name",
     function (results) {
         alert("success");
     },
     function (error){
         alert(error.message);
     },
     function () {
     //OnComplete handler
      }
   );

The code always errors with this message.

Error : 404: Not Found: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 8.0 Detailed Error - 404.0 - Not Found</title>

I am at a loss as to what the cause could be!

thanks.


Maz







Viewing all articles
Browse latest Browse all 1000

Trending Articles