I have used CRM REST builder to generate this code snippet. Basically I am retrieving Fax & FirstName of all the Contacts filtered by AccountId, as Account
has 1:N relation with Contact
v1.5.0.0 support crm 2011.
XrmServiceToolkit.Rest.RetrieveMultiple("ContactSet", "?$select=Fax,FirstName&$expand=contact_customer_accounts&$filter=contact_customer_accounts/AccountId eq (guid'7DD7EE05-FC52-E811-A960-000D3A1A941E')", function(results) {
for (var i = 0; i < results.length; i++) {
var fax = results[i].Fax;
var firstName = results[i].FirstName;
}
}, function(error) {
Xrm.Utility.alertDialog(error.message);
}, function() {
//On Complete - Do Something
}, true);