Hi i'm using odata to retrieve records in MS CRM.i want to write business logic if it does not return any record.How to check that Odata Query is returning 0 records
var odata="$select=*&$filter=Name eq 'Demo'";
SDK.REST.retrieveMultipleRecords("account", retrieveContactsCallBack, errorCallBack, contactsRetrieveComplete);}
// retrieveContactsCallBack - 这是一个成功的回调函数。 // errorCallBack - 这是一个错误回调函数。 // contactsRetrieveComplete - 它是一个完整的函数。
答案 0 :(得分:0)
var totalAccountCount = 0;
var odata="$select=*&$filter=Name eq 'Demo'";
SDK.REST.retrieveMultipleRecords("account", retrieveContactsCallBack, errorCallBack, contactsRetrieveComplete);
}
function retrieveAccountsCallBack(retrievedAccounts) {
totalAccountCount = totalAccountCount + retrievedAccounts.length;
alert(totalAccountCount);
}
Retrieve multiple records using the OData endpoint with JavaScript