質問

I have a SPO site with some DocumentSets having different ContentType. I need to get "Allowed Content Types" of any DocumentSet to take a decision: I get my DocumentSet as ListItem or as Folder or as DocumentSet (Microsoft.SharePoint.Client.DocumentSet) but, in any form it is, I can't find a way to reach the allowed Content Types, any advice?

Thanks in advance.

役に立ちましたか?

解決

You should be able to get it through the UniqueContentTypeOrder property. Here's the part of the code that I used in one of the proejcts to get those values:

var docset = web.GetFolderByServerRelativeUrl("DOCUMENTSETURL");
context.Load(docset);
context.Load(docset, l=> l.UniqueContentTypeOrder); 
context.ExecuteQuery();

foreach(var ctid in docset.UniqueContentTypeOrder)
{
    Console.WriteLine(ctid);
}    
ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top