dynamics-crm Using Web API with jQuery Using filter to filter your API query


Example

You can use the filter property to retrieve a subset of values from CRM. In this example only the accounts where the company name equals CompanyName are returned.

$.ajax({
    url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/accounts?$filter=name eq CompanyName',
    headers: { 
        'Accept': 'Application/json' 
    }
}).done(function (result) {
    var accounts = result.value;
});