gpt4 book ai didi

javascript - XrmServiceToolkit 检索实体

转载 作者:行者123 更新时间:2023-11-28 07:48:26 25 4
gpt4 key购买 nike

快速摘要:通过电话调用事件,我有一个相关的实体联系人,然后我将联系人与帐户相关联。因此,通过电话调用,我想从相关联系人的帐户获取一些数据,并通过以下方式执行此操作:

     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);

其中,Contact 中的 ParentCustomerId 属于“Entity”类型。我可以获取帐户的名称(通过 account.Name)和其他一些(看似)随机字段(其中没有一个是我需要的),但不能获取帐户的 ID(然后我可以在另一个检索中使用它) )。想法?

最佳答案

如果您可以执行 account.Name,那么 account.Id 应该是同一帐户对象的一部分。在 OData 领域,大小写很重要,请确保您通过“account.Id”获取 id,而不是“account.id”或“account.ID”

关于javascript - XrmServiceToolkit 检索实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27159193/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com