Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

calling retrieveRecord in sdk.jquery.js returns undefined in success callback

$
0
0

Hi

I am creating a web resource according to this sample, I can call retrieveMultipleRecords from SDK.Jquery.JS library and get results but when I call retrieveRecord, in it success call back I got undefined as a result. I checked it implementation and I saw that there was not any error and ajax call returns  xhr.responseText 

here is the js code I Use:

$(function () {

  
   var id=window.parent.Xrm.Page.data.entity.getId();
   
   FillContactsList(id);

});

function FillContactsList(recordid)
{
   var _results=null;

   SDK.JQuery.retrieveMultipleRecords("new_customEntity","$filter=new_course/Id eq guid'"+recordid+"'",function(results) {    
   _results= results;
   if(_results!=null)
	{
		$.each(_results, function() {
			 $('#studentsList').append(this.new_student.Name+'\n');
			 GetContactMobile(this.new_student.Id);
		});
	}
   },function(x){alert(x.message)},function(){});

   
   
   
}



function GetContactMobile(id)
{
 
 SDK.JQuery.retrieveRecord(
     id,
     "Contact",	
     null, null,
     function (c) {
		$('#studentsList').append(c.mobilephone);
     },
     function(x){alert(x.message)}
   );
}


So What Should I Do ?



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>