SingleOrDefault不返回父实体-HTML客户端 [英] SingleOrDefault not returning parent entity - HTML Client

查看:83
本文介绍了SingleOrDefault不返回父实体-HTML客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用JavaScript代码如下:

I am currently using  JavaScript code like below:

myapp.activeDataWorkspace.CRMData.Activities_SingleOrDefault(sender.data.ID).execute().then(
函数(结果){
   var acti = results.results [0];
}

myapp.activeDataWorkspace.CRMData.Activities_SingleOrDefault(sender.data.ID).execute().then(
function (results) {
   var acti = results.results[0];
}

一切工作正常,除了活动对象"acti"比其他情况更多.不包含相关的父母(例如我的公司和联系人),即使这些父母不为空.

Everything works fine except that more often than not the Activities object "acti" does not contain related parents (like in my case Company and Contact), even if these are not null.

引用父实体(例如"acti.Company")似乎会使执行下次执行预期.

Referencing the parent entities (like "acti.Company") seems to make the execute perform as expected next time.

我想这是默认延迟加载的结果,我正在寻找一种方法来强制execute()加载所有数据,因为我正在使用返回的实体导航到编辑屏幕.

I suppose this is a consequence of default lazy loading, and I am looking for a way to force the execute() to load all data, as I am using the returned entity to navigate to en edit screen.

有什么建议吗?

最诚挚的问候,

詹斯

推荐答案

通过检查查询的管理包含的数据"并选择包含公司"来查看是否可以包含公司.  否则,您也许可以手动加载它们:acti.getCompany().then(function(company){//在这里处理company });
See if you can you include Companies by checking the query's Manage Included Data and selecting Include for Companies.  Otherwise you might be able to load them manually: acti.getCompany().then(function (company) { // do stuff with company in here });


这篇关于SingleOrDefault不返回父实体-HTML客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆