Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

how we can retrieve multiple record from a form using JavaScript

$
0
0
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.lenght;i++){
              console.log(result.entities[i]);
              }
          },
          function(error){
              debugger;
              console.log(error.message);
          }
       );

Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images