我正在使用jQuery 1.4.1,JSON 2和SDK.JQuery.js(它是CRM SDK中提供的REST DataOperation的包裝)。而使用SDK.JQquery.RetrieveMultipleRecords函數時,我無法讀取成功響應。爲了闡述目的,我通過alert函數在下面解釋。CRM 2011:無法讀取RetrieveMultipleRecords成功返回的[Object Object]
順便說一句,代碼正在正確執行,並給出3個記錄,這也是正確的。
代碼如下: -
SDK.JQuery.retrieveMultipleRecords(
"Contact",
"$select=FullName,ContactId&$filter=zk_cdn eq 'zk007'",
function(results) {
////TODO: How to read results?
//If I use alert(results) it give the output as [object Object],[object Object],[object Object]
//If I use alert(results[0]) it give the output as [object Object]
//If I use alert(results[0].FullName) it give the output as unidentified
},
errorHandler,
function() {//OnComplete handler }
);
function errorHandler(error) {
alert(error.message);
}
期待聽到您的意見。提前致謝。
調試。在成功函數中放置一個斷點,並確切地查看結果[0]中的含義。 – 2013-03-02 22:20:02
謝謝你的回覆。 – Zohaib 2013-03-04 06:25:55