Thursday, June 16, 2011

Tips for using REST endpoints in CRM 2011(Rest endpoints browser)

Using REST endpoints with json2 are the simplest way to retrieve data in CRM 2011. The code is clean and simple. Here is a sample retrieve request"GET", getRESTUrl() +

eq ('"
+ postcode + "')", true);

The above request is used to retrieve the custom entity (new_postcode) dataset where new_name is equal to postcode.

The result will look like this
To get the fieldnames for an entity you can use http://servername:portnumber/organization name/XRMServices/2011/OrganizationData.svc/entitySet

The result will look like this


You can even paste the query in the browser and check the result of the query. The following query will display all the records with postcode 2010.


The result will look like this



REST endpoints are the best way to retrieve data on client site. You can even see the result of the query in the browser.

Happy Programming……..


  1. Nice info, however I can't seem to get any custom entities to work (even using the prefix)

    1. What's the error message? I am using custom entity new_postcode in the above examle.

    2. Singh, i created a custom field called "field_A" for contacts, noticed it appeared in the ContactExtensionBase table. How do i get "field_A" from this table.

      For AccountBase look at the code (it works perfectly)
      var filterx = '/AccountSet?';
      var filterz = "$select=AccountNumber,AccountId&$filter=AccountId eq (guid'" + accid + "')";

      now to get "field_A" from ContactExtensionBase i go like this
      var filterx = '/ContactExtensionSet?';
      var filterz = "$select=new_CustomerID&$filter=ContactId/Id eq (guid'" + accid + "')";

      i get error 404 for XMLHttpRequest status.
      Thank you.

    3. Got the Solution
      Used ContactSet instead of ContactExtensionSet

      var filterx = '/ContactSet?';
      var filterz = "$select=new_CustomerID&$filter=ContactId eq (guid'" + accid + "')";

  2. Is it possible to query using lookup text value in crm jscript?

  3. Microsoft Dynamics CRM training will help you manage and prioritize your business goals, customize.we teach MS Dynamics CRM training and class available at Hyderabad.