Respondida New List Item type.

  • 2010년 6월 25일 금요일 오전 8:02
     
     

    Hello!

    I want to create a new type of Item for List. This new Item must contain two properties of SPAttachmentsCollection type.

    How can I do it? Need I inherit from SPListItem?

    Thank you!

     

     

     

모든 응답

  • 2010년 6월 25일 금요일 오전 10:37
     
     
  • 2010년 6월 26일 토요일 오후 11:23
     
     제안된 답변
    You are not going to be able to do that. SPListItem implements only one attachment collection and the code for implementing it is internal. What are your requirements, another linked list of documents for a list item? You can do this by creating another list that the source list is linked to by a look up column. The actual viewing of the linked documents could be implemented via a web part.
    certdev.com
    • 답변으로 제안됨 Ivan SandersMVP 2010년 6월 26일 토요일 오후 11:30
    •  
  • 2010년 6월 27일 일요일 오전 4:09
     
     
    Or you could avoid using attachments and use two custom created multi valued lookup column on documents of a document library that wil act as your "attachement repository"... if you want these field to act in the edit form as attachement column then you could create a custom field type inheriting from lookupfield that allow you to upload the attachement to document library and automatically add lookupvalue into the field wich could be complex but in total respect of the product!
  • 2010년 6월 28일 월요일 오전 9:46
     
     

    Thank you very much!

     

    I need to make some content type what will represent Loan Application. It must have several file attachments and that file attachments must be grouped in several sets.

    As you said I can't do it by inheriting from SPListItem.

    I want to ask, can i at all inherit from SPListItem and create my own content type??

    Or, maybe, i can create new class by inheriting from SPList class and encapsulate my file repository inside this new class as one of private members of this new class??

     

    Thank you!

  • 2010년 6월 28일 월요일 오후 12:44
     
     답변됨

    Instead of re-inventing the wheel I would suggest using the new SP2010 "Document Set" feature.  This is a type of folder created to help you design a process around your document management such as a loan process. It allows you define what type of documents can be put in the document set, any default documents that need to be created whenever a new document set is created and any shareable properties among the documents. In your case, I would try grouping your documents within the document set using metadata. This would allow you to search for certain types of documents within the "loan" document set. Another alternative would to use just plain old folders. So you would have one folder for the loan and sub-folders holding the type of documents you want.

    Trying to develop a custom "compound" list item is not going to work. Try leveraging what SP already gives you.

    http://www.cmswire.com/cms/document-management/sharepoint-2010-document-sets-organize-related-documents-for-project-based-work-006982.php


    certdev.com
    • 답변으로 표시됨 LevonHak 2010년 6월 30일 수요일 오전 11:01
    •  
  • 2010년 6월 30일 수요일 오전 11:01
     
     

    Thank you, Steve!

    I think, Document Set feature is exactly what i need.

  • 2010년 7월 6일 화요일 오전 10:05