Monday, October 26, 2015

Retrieve Record using XrmSvcToolkit

Code Snippet:

XrmSvcToolkit.retrieve({
  entityName:"Account",
  id:"FEA6C92D-1696-E411-80D8-C4346BAD26DC",
  select:["Name","Telephone1","Fax","WebSiteURL","PrimaryContactId"],
  async:false,
  successCallback:function(result)
  {
      alert("Details of Record:\nName :"+result.Name+"\nPhone :"+result.Telephone1+"\nFax:"+result.Fax+"\nWeb :"+result.WebSiteURL+"\nContact :"+result.PrimaryContactId.name);
  },
  errorCallback:function(error)
  {
     alert("Failed to retrieve record");
  }
});

No comments:

Post a Comment