RE: How to Query data in Dynamics 365
i can't paste a screenshot, but here is my code :
$("customer").change(function(){
var name = $("#td_contadoendereco_name").val();
var id = $("#td_contadoendereco").val();
var entityname = $("#td_contadoendereco_entityname").val();
if(ContaDoEndereco != null){
var ODataUrl = "trialbdan.api.crm2.dynamics.com/.../td_conta$filter=td_contatosdacontaid eq '"+id+"'";
$.ajax({
type: 'GET',
url: ODataUrl,
success: function (data) {
debugger;
if (data.value.length > 0) {
var ContaId = data.value[0]._td_conta_value;
//$("#parentcustomerid_name").attr("value","A J E CALDER LTD");
$("#parentcustomerid").attr("value",ContaId);
//$("#parentcustomerid_entityname").attr("value","contact");
}
else {
alert("sorry that address cannot be found");
}
},
error: function (jqXHR, textStatus, errorThrown) {
debugger;
}
});
}
});
When i debug the code shows that "data is undefined".