Reputation: 4884
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.
Upvotes: 2
Views: 1480
Reputation: 10345
In addition to Hidden, try taking out Fields where:
true
.Computed
_Hidden
Upvotes: 0