如何在其使用的本地子站点而不是根站点中查找文档库?
我的内容类型在其子站点中有一个文档库的查找字段。内容类型被声明为网站集根级别,但我希望查找字段在使用的本地子网站中查找文档库。我使用 PowerShell 部署内容类型,并使用事件接收器添加查找字段。但是,我无法让它引用正确的列表,它只引用根网站集中的列表。
如何覆盖查找列表?
I have a content type that has a lookup field for a document library in its sub site. The content type is declared a site collection root level but I want the look up field to look up the document library in its local sub site where used. I deploy the content types using PowerShell and have used an event receiver to add the look up field. I can't however get it to reference the correct list, it only ever references the list at the root site collection.
How can I overwrite the look up list?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我避免在 Field 元素 中设置 List 属性。当自定义字段设置了“列表”属性时,我在将网站保存为模板时遇到问题。但另一个问题是这些属性是一次性写入的。最好在定义中将其留空,然后使用 SPFieldLookup.LookupWebId 和 SPFieldLookup.LookupList。
I avoid setting the List attribute in the Field element. I have had problems saving the site as a template when a custom Field has the List attribute set. But the other problem is that these properties are write-once. Better to leave it blank in the definition and then set it in the instance programmatically using SPFieldLookup.LookupWebId and SPFieldLookup.LookupList.