我正在使用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