Reputation: 11
Hashtable docProps = new Hashtable();
docProps.Add("Field1", myvalue);
docProps.Add("Field2", "slsl");
docProps.Add("Field3", "wwowowo");
try
{
DocumentSet ds = DocumentSet.Create(list.RootFolder, "mydocumentset", list.ContentTypes["CustomDocumentSet"].Id, docProps);
}
This will add the document set, but value of the hashtalbe is not being accepted.
Upvotes: 1
Views: 1286
Reputation: 11
I had the same question and this is how I solved it. Basically we are referring to a wrong name. You can find teh correct property name by looping through the fieldlinks in the contentType. DocumentSet docSet = DocumentSet.Create(parentFolder, DocumentSetName, docsetCT.Id, properties,true);
put a quick watch on below and see teh property names by looping through the fieldlinks.
docSet.ContentType.FieldLinks[0]
I hope it solves your problem. I spent quite some time on this.
Regards Abir
Upvotes: 1
Reputation: 2364
you are missing some input parameters for the create method.
http://msdn.microsoft.com/en-us/library/ee588760.aspx
Upvotes: 0