Hello everyone,
I'm currently writing a script that tries to obtain the account entity connected with a contact. I'm using the command below:
Xrm.WebApi.retrieveRecord("contact", recid2, "?$select=fullname&$expand=parentcustomerid($select=name)").then( function success(result) { console.log("Retrieved values: Name: " + result.fullname); }, function (error) { console.log("Query failed"); }
If I remove the &$expand=parentcustomerid($select=name) it works normally, and it returns the contact's fullname. But with it,
the query fails and it returns the "Query failed" message. I've noticed that the field parentcustomerid of the contact entity is not a Lookup field but a Customer Type.
How can I get the account name of the related account of this contact?
*This post is locked for comments