Hi, I am trying to use this code to fetch records and applying to a dashboard to filter according to the record but I am getting an error in this code.
debugger;
var formContext = context.getFormContext();
var FetchXML="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
"<entity name='campaign'>" +
"<attribute name='name' />" +
"<attribute name='istemplate' />" +
"<attribute name='statuscode' />" +
"<attribute name='createdon' />" +
"<attribute name='campaignid' />" +
"<attribute name='typecode' />" +
"<order attribute='name' descending='true' />" +
"</entity>" +
"</fetch>";
FetchXML = "?fetchXml=" + encodeURIComponent(FetchXML);
parent.Xrm.WebApi.retrieveMultipleRecords("campaign",FetchXML).then(
function success(result){
debugger;
for(var i=0;i<result.entities.length;i++){
console.log(result.entities[i]);
}
},
function(error){
debugger;
console.log(error.message);
}
);