Sharepoint:获取表单字段'显示列表中的名称

发布于 2024-10-24 21:00:14 字数 779 浏览 3 评论 0原文

我正在尝试从列表中提取字段名称,但仅限于通常显示在编辑/查看表单中的字段名称。然而,事实证明这比最初想象的要困难。

通过简单地不采用 SPField.Hidden == true 的字段来过滤字段,仍然会产生许多在此上下文中不相关的字段。作为示例,标准文档库会产生以下结果:

FileLeafRef, Title, CaseID, DocID, Finalized, Related, RegistrationDate, ItemSelectField,
ExtendedDocIcon, CaseRecordNumber, Local_x0020_Attachment, ID, ContentType, Created,
Author, Modified, Editor, _CopySource, CheckoutUser, _CheckinComment, LinkFilenameNoMenu,
LinkFilename, FileSizeDisplay, Edit, _UIVersionString, ParentVersionString, ParentLeafName

我采用了内部名称,因为我有 Sharepoint 的丹麦本地化版本,但您明白了。在上面的 Title、CaseID、DocID 和 LinkFilename 中,也许还有其他一些字段是相关的 - 可以肯定的是,当您查看项目或插入新项目时,显示的这些字段中不到一半。

我尝试了 SPField.ShowIn* (DisplayForm、EditForm 等),但所有字段都设置为 null 或 false。

I am trying to extract the field names from a list, but only those that are normally displayed in the edit/view-form. However, it is turning out to be more difficult than first assumed.

Filtering fields by simply not taking those with SPField.Hidden == true still yields a lot of fields that are not relevant in this context. A standard document library yields this result as example:

FileLeafRef, Title, CaseID, DocID, Finalized, Related, RegistrationDate, ItemSelectField,
ExtendedDocIcon, CaseRecordNumber, Local_x0020_Attachment, ID, ContentType, Created,
Author, Modified, Editor, _CopySource, CheckoutUser, _CheckinComment, LinkFilenameNoMenu,
LinkFilename, FileSizeDisplay, Edit, _UIVersionString, ParentVersionString, ParentLeafName

I have taken the internal names because I have a danish localized version of Sharepoint, but you get the idea. In the above Title, CaseID, DocID and LinkFilename and perhaps some more fields will be relevant - one thing is for sure, less than half of these fields are displayed when you view the item or insert a new one.

I tried the SPField.ShowIn* (DisplayForm, EditForm, etc.) but they're all set to null or false for all the fields.

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

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

发布评论

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

评论(2

以酷 2024-10-31 21:00:14

除了隐藏之外,尝试取出以下字段:

  • ReadOnly 为 true
  • 类型为已计算
  • 组为_Hidden

In addition to Hidden, try taking out Fields where:

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