Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

what's wrong with this odata query?

$
0
0

Hello - I have the following odata query:

    var Odata = svcPath + "/SystemUserSet?$select=SystemUserId&$filter=InternalEmailAddress eq '" + "admin@myco.com" + "'";

The intent is to retrieve the user ID by email address. However, the ajax call is returning the following error:

    "No property 'InternalEmailAddress' exists in type 'Microsoft.Sdk.Entity' at position 0"

I did a quick google and people seem to think this error message indicates that something is wrong with the query. The query looks ok to me but this is my fist odata query.  Here's the full function that performs the lookup and returns data:

function getAdminUserIdByEmail()
{
    //Creating the Odata Endpoint
    var svcPath = Xrm.Page.context.getServerUrl() + "/XRMServices/2011/OrganizationData.svc";
    var retrieveReq = new XMLHttpRequest();
    var Odata = svcPath + "/SystemUserSet?$select=SystemUserId&$filter=InternalEmailAddress eq '" + "admin@myco.com" + "'";
    retrieveReq.open("GET", Odata, false);
    retrieveReq.setRequestHeader("Accept", "application/json");
    retrieveReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    retrieveReq.onreadystatechange = function () 
    { 
        if (this.readyState == 4 && this.status == 200) {
   alert(this.responseXML);
   alert(this.responseText);
}
else
{
   alert(this.responseXML);
   alert(this.responseText);
}
    };
    retrieveReq.send();
}

Viewing all articles
Browse latest Browse all 8223

Trending Articles



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