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

CRM REST builder code doesn't run in CRM. Error result not defined

$
0
0

Hi,

I'm using CRM rest Builder to build my query and it works exactly as needed, but when I paste it into CRM I'm getting Success and result are not defined.  

function webapicode()
{
debugger;

Xrm.WebApi.online.retrieveRecord("contact", "9AD61380-F804-E711-8100-5065F38A5961", "?$select=_accountid_value,fullname,_parentcustomerid_value&$expand=parentcustomerid_account($select=telephone1)").then(
function success(result) {
var _accountid_value = result["_accountid_value"];
var _accountid_value_formatted = result["_accountid_value@OData.Community.Display.V1.FormattedValue"];
var _accountid_value_lookuplogicalname = result["_accountid_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
var fullname = result["fullname"];
var _parentcustomerid_value = result["_parentcustomerid_value"];
var _parentcustomerid_value_formatted = result["_parentcustomerid_value@OData.Community.Display.V1.FormattedValue"];
var _parentcustomerid_value_lookuplogicalname = result["_parentcustomerid_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
if (result.hasOwnProperty("parentcustomerid_account")) {
var parentcustomerid_account_telephone1 = result["parentcustomerid_account"]["telephone1"];
}
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);

}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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