Sharepoint:获取表单字段'显示列表中的名称
我正在尝试从列表中提取字段名称,但仅限于通常显示在编辑/查看表单中的字段名称。然而,事实证明这比最初想象的要困难。
通过简单地不采用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
仅来自 Sharepoint 列表的自定义字段
Try this:
Custom Fields Only From Sharepoint List
除了隐藏之外,尝试取出以下字段:
true
。已计算
_Hidden
In addition to Hidden, try taking out Fields where:
true
.Computed
_Hidden