Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Document Set Created Programmatically Misbehaves

$
0
0

I'm trying to create a document set trough code:

SPFolder folderToInsertIn = list.RootFolder;

SPContentTypeId dsCtId = new SPContentTypeId();

dsCtId = web.ContentTypes[docsetName].Id;

properties.Add("Description", "");

DocumentSet.Create(folderToInsertIn, "Temp2", dsCtId, properties, true);

It creates it, but instead of a full-fledged document set, it creates useless folder-type of object (when I open it, I cannot add a document to it):

But, if I create a document set manually, it look and behave as a normal document set.

If I compare the Uris to the weird and normal (manually created) document sets, they look different as well:

Weird one: ?RootFolder=%2Fsites%2F...%2FTemp2&FolderCTID=0x0120D520008E69376858B773408467F7E3281980A700FA658E371CFB9C43B9445795FCFCFA43&View={B8C5F114-0F7C-4365-8EBF-8A63A51D56E6}

Normal: ?ID=9&FolderCTID=0x0120D520008E69376858B773408467F7E3281980A700FA658E371CFB9C43B9445795FCFCFA43&List=4c7ba4b8-400b-40b6-a234-1241ffb83e5a&RootFolder=%2Fsites%2F...%2FTest

Can anyone tell me how to create a normal document set programmatically?


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>