A couple years ago I posted here about how to use this method: https://community.dynamics.com/crm/f/117/t/242500
I solved the issue as noted there, but now I'm trying the same thing an another entity and it's not working.
The code is on the new_Invoice entity, and I'm trying to access a field on the out-of-box Account entity.
Here's my code:
var companyID = Xrm.Page.getAttribute('new_companyid').getValue()[0].id;
var APContact = null;
var name = null;
SDK.REST.retrieveRecord
(
companyID,
'Account',
null, null,
function (Account)
{
APContact = Account.new_AccountsPayableContactId;
},
function Error()
{
alert('There is an error in reading account data.');
}
);In all my tests, APContact has always ended up null within the function and after it. What am I doing wrong?






