相关Sharepoint列表缺少导航属性-BUG? [英] Related Sharepoint Lists Missing Navigation Properties - BUG?

查看:85
本文介绍了相关Sharepoint列表缺少导航属性-BUG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个SharePoint列表之间的关系的父级缺少导航属性-为什么?

There are missing navigation properties on the parent side of a relationship between two SharePoint lists - Why?.

除了失去导航属性的所有优点之外,它还会破坏新的内置SharePoint上传控件.

In addition to losing all the benefits of the navigation properties, it breaks the new built-in SharePoint Upload Control.

  使用查找列连接到两个相关"的SP列表时,父级不会获得导航属性,并且该关系不可编辑.此外,该关系在关系窗口中不可编辑.作为解决方法, 我修改了文档库的实体.lsml(在我的情况下为Documents.lsml)

When you connect to two SP lists which are 'related' using a lookup column, you don't get a navigation property on the parent side and the relationship is not editable.  Also the relationship is not editable in the relationship window.  As a workaround,  I modified the entity .lsml for the document library (Documents.lsml in my case)

从数据源目录中的.lsml中删除此文本:

Removed this text from the .lsml in data sources directory:

        <NavigationProperty.Attributes>
          <Hidden />
        </NavigationProperty.Attributes>

进行更改后,您可以在父侧命名导航属性,并且它是固定的.

After that change is made, you can name the Navigation Property on the parent side and it's fixed.

例如,我有一个名为联系人"的SP列表和一个名为文档"的库.文档中有一个查阅列,可将项目与联系人相关联.该查找成为LS中的关系,并且文档实体具有导航 联系的属性.但是,联系人实体不具有文档"的导航属性.结果,上传控件无法正常工作,因为它会检查关联链接,如果不存在,则会呕吐错误并退出.

For example,  I have a SP list called 'Contacts' and a library called 'Documents'.  There is a lookup column in Documents that relates the items to a Contact.  This lookup becomes a relationship in LS and the documents entity has a navigation property to Contact.  However, the Contact entity does not have a navigation property to Documents.  As a result the upload control doesn't work because it checks for association links and if not present it pukes an error and quits.

要解决此问题,我编辑了Documents.lsml并删除了上面的代码,然后在关系的联系人"侧添加了nav属性.

To fix this I edited the Documents.lsml and removed the above code and then added a nav property on the Contacts side of the relationship.

如果导航属性位于关系的两边,那将是很好的,因为每次更新数据源"时都必须重复进行导航.

It would be nice if the navigation properties were on both side of the relationship to begin with as this will likely have to be repeated every time you 'Update Data Source' 

这是一个错误吗?

HTH,

乔什

推荐答案

Hello Josh,

Hello Josh,

我认为这是当前不受支持的方案.导航属性在关系的两边都不存在的原因是,这是关系在SharePoint OData提要(ListData.svc)上公开的方式. LightSwitch用于访问SharePoint数据. SharePoint不会将双向关系公开.如您所述,您可以修改lsml,以便LightSwitch在关系的两边都创建一个导航属性, 但是导航属性不能完全发挥作用.它不能完全正常运行的原因是因为SP OData提要不具有LightSwitch依赖的导航属性.例如,您创建的导航属性无法 急于加载,可以在任何类型的查询限制中使用,也可以在查询排序中使用,等等.

I would consider this as a currently unsupported scenario.  The reason why the navigation property does not exist on both sides of the relationship is because this is how the relationship is exposed on the SharePoint OData feed (ListData.svc) that LightSwitch uses to access SharePoint data.  SharePoint does not expose the relationships as bi-directional.  As you noted you can modify the lsml so that LightSwitch will create a navigation property on both sides of the relationship, however the navigation property is not fully functional.  The reason it is not fully functional is because the SP OData feed does not have the navigation property which LightSwitch relies on.  For example the navigation property you created cannot be eagerly loaded, it be used within any type of query restriction, it be used within a query sort, etc.

Michael


这篇关于相关Sharepoint列表缺少导航属性-BUG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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