Group.CreateTermSet method (String, Int32)
Creates a new TermSet object in the current Group object by using the provided language.
Namespace: Microsoft.SharePoint.Taxonomy
Assembly: Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
Syntax
'Declaration
Public Function CreateTermSet ( _
name As String, _
lcid As Integer _
) As TermSet
'Usage
Dim instance As Group
Dim name As String
Dim lcid As Integer
Dim returnValue As TermSet
returnValue = instance.CreateTermSet(name, _
lcid)
public TermSet CreateTermSet(
string name,
int lcid
)
Parameters
name
Type: System.StringThe name of the TermSet object being created.
lcid
Type: System.Int32The language that the new TermSet name is in
Return value
Type: Microsoft.SharePoint.Taxonomy.TermSet
The newly created TermSet
Exceptions
Exception | Condition |
---|---|
UnauthorizedAccessException | The current user has insufficient permissions to perform this operation. |
TermStoreOperationException | Creating a term set in system Group is disallowed. |
ArgumentException | The name parameter is invalid. It either contains invalid characters, is too long, or conflicts with the name of an existing TermSet in the same Group. |
ArgumentNullException | The name cannot be null or empty. |
ArgumentOutOfRangeException | The lcid is not one of the working languages for the term store |
Remarks
The name cannot exceed 255 characters, and it cannot contain any of the following illegal characters: ; " < > | & tab
Additionally the name must be a unique TermSet object name within the current Group object. The current user must have TaxonomyRights.EditTermSet permission to use this method. Call the CommitAll() method to save this change to the database.