Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a document library using a document set content type. I can create a new document set through the UI and it works perfectly.

I'm now trying to create a document set in this library programmatically and it's not working properly. Here is the code (based on MSDN documentation):

// Set some properties
Hashtable properties = new Hashtable();
properties.Add("UploadComplete", false);
properties.Add("FilenameCode", code);

// Create the set
DocumentSet invoiceSet = DocumentSet.Create(
  list.RootFolder, code, InvoiceSetContentTypeId, properties, true);

What's not working:

  • icon for the set looks like a folder instead of the document set icon

  • clicking on the document set doesn't show the document set home page, it just behaves like a normal document library

  • running CAML queries shows that both internal fields HTML File Type and ProgId should be SharePoint.DocumentSet but instead they are blank

  • changing a field value on the document set folder doesn't propogate to its contents (although perhaps this is supposed to work differently)

Anyone know what I'm doing wrong?

share|improve this question
add comment

3 Answers

I had this issue with some folders I had converted to document sets, and I don't know whether this solution will work for you. But I submitted them to the content organiser and let the content organiser put them back into the original location, all the document set properties were correct, I got the icon back, and the welcome page etc.

Like I said, not sure if this will help you, but it may be an option.

share|improve this answer
add comment

J had the some issue. To solve the problem You must use content type id from the list, which is child of Your custom content type id.

DocumentSet invoiceSet = DocumentSet.Create(list.RootFolder, code, list.ContentTypes.BestMatch(InvoiceSetContentTypeId), properties, true);

share|improve this answer
add comment
up vote -1 down vote accepted

I deleted the Document content type from the library which resulted in Document Sets only working through the UI.

share|improve this answer
    
I followed your instructions, but this did not solve the problem. Any other suggestions? –  user1546 Sep 30 '10 at 14:37
    
Do you have the exact same symptoms? If not, you should ask a new question describing the exact issue you're having. If you are then sorry I'm not sure what else would help. –  Alex Angas Sep 30 '10 at 22:52
    
hi alex i tried your method it did not work. i then tried the the above method and it worked perfectly. i had the exact same issue as you had –  Sebastien Stettler Mar 1 '12 at 15:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.