Rest.Retrieve of type 'Entity'

Nov 26, 2014 at 5:20 PM
Edited Nov 26, 2014 at 8:07 PM
Hey guys,

A quick summary: From a Phone Call Activity I have a related Entity Contact, I then relate a Contact to an Account. So, from Phone Call I want to get some data from the related Contact's Account and do this by:
         var lookup = Xrm.Page.getAttribute("regardingobjectid").getValue();
         XrmServiceToolkit.Rest.Retrieve(lookup[0].id,
                    'ContactSet',
                    'ParentCustomerId',
                    null,
                    function (account) {
                        alert(String(account));
                    },
                    function (error) {
                        alert("in error handler");
                        alert(error.message);
                    }, true);
Where ParentCustomerId is of type 'Entity' in Contact. I can get the Name of the account (by account.Name) and a few other (seemingly) random fields (none of which are the one I need), but not the ID of the account (which then I can use in another Retrieve).
Thoughts?
Coordinator
Feb 8, 2015 at 5:50 PM
Hi There.

Some fields in CRM store different schema names in CRM. I will recommend use a tool to check the field name and build your query.

Kind Regards,
Jaimie