Sharepoint: Get form fields' display names from list
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 t开发者_运维技巧urning 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.
Try this:
Custom Fields Only From Sharepoint List
In addition to Hidden, try taking out Fields where:
- ReadOnly is
true
. - Type is
Computed
- Group is
_Hidden
精彩评论