I have a custom entity, which is related to a custom "property" entity that has a contact lookup on it. I want to retrieve that contact. In the code below, I am supplying the guid of the "property" entity, along with the "nna_ownercontactid" column. I get "success" but it reports "undefined" for that column, and every other column (including even a "name" column.) I've tried it with and without the "nna" prefix for this and other columns as well.
What am I missing? As a point of reference, I built this using the Retrieve function from Sumedha Obeysekera's blog below. The Retrieve function worked fine, but not mine. Thanks for your help!
function RetrievePropertyContact(prop2) {
var re;
XrmServiceToolkit.Rest.Retrieve(
"{" + prop2 + "}",
"nna_propertySet",
null, null,
function (result) {
re = result;
alert("success");
alert(re.nna_ownercontactid);
},
function (error) {
alert("failed");
},
false
);
//debugger;
alert(re.nna_ownercontactid);
}
sumedha8.blogspot.co.uk/.../rest-functions-from-xrmservicetoolkit.html
function Retrieve() {
var re;
XrmServiceToolkit.Rest.Retrieve(
"{EE81D2A9-E28E-E311-96DF-D89D6765B238}",
"AccountSet",
null, null,
function (result) {
re = result;
alert("success");
},
function (error) {
alert("failed");
},
false
);
//debugger;
alert(re.Name);
alert(re.AccountId);
}