CREATEDOCUMENTSET

Used to create a folder as a document set in a document library. A document set is a group of related documents that can be created in one step and then managed as a single entity. The Connector applies the provided document set content type on the folder. The document set content type includes several capabilities that make it easier to create and manage multi-document work products successfully.

Syntax

CREATEDOCUMENTSET(string listName, string folder, string contentType, [boolean recursive = false]);

Example: to create folder Images as document set CompanyImagesSet in document library Shared Documents:

CALL CREATEDOCUMENTSET('Shared Documents', 'Images', 'CompanyImagesSet');

It is also possible to create document sets in existing folders.

Example: to create subfolder Logos as document set CompanyImagesSet under folder Images in document library Shared Documents:

CALL CREATEDOCUMENTSET('Shared Documents', 'Images/Logos', 'CompanyImagesSet');

By default all parent folders must exist when creating subfolders. Use the recursive parameter to create all subfolders recursively. The document set content type will be applied on all subfolders.

Example: to create subfolder a/b/c/d recursively as document set CompanyImagesSet in document library Shared Documents:

CALL CREATEDOCUMENTSET('Shared Documents', 'a/b/c/d', 'CompanyImagesSet', true);

Code examples

Create document set

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand(@"CALL CREATEDOCUMENTSET('Shared Documents', 'Images', 'CompanyImagesSet')", connection))
    {
        command.ExecuteNonQuery();
        Console.WriteLine("ID = " + command.LastInsertedId);
    }
}

Code result

ID = 874


Skip Navigation Links.

Visa     MasterCard