选择字段上的 Sharepoint LookUp 字段?

发布于 2024-12-06 05:59:39 字数 97 浏览 0 评论 0原文

如何为选择字段创建查找字段..例如:在列表中我有选择字段,并且我必须在其他列表中创建指向此选择字段的查找列..当我选择此列表时,此列不会出现在下拉列表中...请告诉我是否有任何限制

How to create a lookup field for the Choice field..For eg: In a list i have Choice field and i have to create an lookup column in other list pointing to this choice field ..When i select this list this column is not appearing in the dropdown...Please let me know if there is any Limitation for that

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

天生の放荡 2024-12-13 05:59:40

无法为选择(下拉)字段创建查找字段。有两种方法可以解决您的问题:编程方法和解决方法。

编程方法涉及创建事件接收器来实现魔法 - 工作量很大。但这里有一个解释:

您可以也只需创建另一个列表,其中包含您选择的字段值,并使用计算字段作为查找列的源。查看以下说明:

It is not possible to create a lookup field for a choice (dropdown) field. There are two ways to resolve your problem: The programmatic approach and the workaround.

The programmatic approach involves an creating event receiver to do the magic - pretty work intensive. But there is an explanation here:

You can also just create another list, containing your choice field values and use a calculated field as a source for your lookup column. Check out the following explanation:

与君绝 2024-12-13 05:59:40

编程解决方案面临无限递归的风险:

ItemAdded 事件和 UpdatedEvent 是异步的。这意味着命令: this.EventFireingEnabled = false 不是线程安全的。在 systemUpdate 之后,将 EventFireingEnabled 设置为 true。

但是因为 ItemUpdated 是异步的,所以您不能保证此时已经调用了 system.update 的 ItemUpdated!

the programmatical Solution is at risk to run into an endless recursion:

The ItemAdded Event and UpdatedEvents are asynchrone. This means, that the command: this.EventFireingEnabled = false is not threadsafe. After systemUpdate you set EventFireingEnabled to true.

But because the ItemUpdated is asynchronus, you cannot guarantee, that the ItemUpdated for your system.update has already been called at this time!.

Hello爱情风 2024-12-13 05:59:40

您可以使用计算列作为源列表,它将显示选择列的值。然后您可以为此计算字段添加查找列。它仅适用于具有单一选择的选择列。对于多重选择,您可以使用第三方组件,如下所示:
http://www.sparqube.com/SharePoint-Lookup-Column

You can use calculated column is source list, that will display value of Choice column. Then you can add lookup column for this calculated field. It will work only for Choice column with single selection. For multiple selection you can use 3rd party components like that:
http://www.sparqube.com/SharePoint-Lookup-Column

一桥轻雨一伞开 2024-12-13 05:59:40

它对我来说是开箱即用的...但是只有当您转到“列表设置”并单击“创建列”时,查找选项才可用
这是我在 sharepoint 在线上配置我的专栏的方式(2019 年),它工作得很好...这是从本栏下的列表设置屏幕复制并粘贴的...

Column name: Equipment List 
The type of information in this column is: Lookup 
Get information from: Equipment Master List 
In this column: "Equipment Name" (dropdown selector of all the column names on the other list)
Allow multiple values (to be selected)  [TICKED]

下面还有一些注释...

关系
查找列在此列表中的列表项与目标列表中的相关项之间建立关系。指定删除目标列表中的列表项时此查找列强制执行的关系行为。

当删除目标列表中的某个项目时,级联删除将删除该列表中的所有相关项目。如果目标列表中的某个项目在该列表中包含一个或多个相关项目,则限制删除将阻止删除该项目。

强制执行关系行为 [CHECKBOX]

radio buttions:
  Restrict delete
  Cascade delete

It works out of the box for me... but the lookup option is is only available if you go to "List Settings" and click on "Create Column"
here is how I configured my column on sharepoint online (in 2019) and it works perfectly... this is copy and pasted from the list settings screen under this column...

Column name: Equipment List 
The type of information in this column is: Lookup 
Get information from: Equipment Master List 
In this column: "Equipment Name" (dropdown selector of all the column names on the other list)
Allow multiple values (to be selected)  [TICKED]

there are some notes lower down too..

Relationship
A lookup column establishes a relationship between list items in this list and related items in the target list. Specify the relationship behavior enforced by this lookup column when a list item in the target list is deleted.

When an item in the target list is deleted, cascade delete will delete all related items in this list. Restrict delete will prevent the deletion of an item in the target list if it has one or more related items in this list.

Enforce relationship behavior [CHECKBOX]

radio buttions:
  Restrict delete
  Cascade delete
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文