TermSetItem.CreateTerm TermSetItem.CreateTerm TermSetItem.CreateTerm Method

Definition

Overloads

CreateTerm(String, Int32) CreateTerm(String, Int32) CreateTerm(String, Int32)

Creates a new Term below this TaxonomyItem instance.The name is the default Label for the LCID specified.

CreateTerm(String, Int32, Guid) CreateTerm(String, Int32, Guid) CreateTerm(String, Int32, Guid)

Creates a new Term object below this Microsoft.SharePoint.TaxonomyItem object.The name is the default Label for the specified LCID.

CreateTerm(String, Int32) CreateTerm(String, Int32) CreateTerm(String, Int32)

Creates a new Term below this TaxonomyItem instance.The name is the default Label for the LCID specified.

public:
 Microsoft::SharePoint::Taxonomy::Term ^ CreateTerm(System::String ^ name, int lcid);
public Microsoft.SharePoint.Taxonomy.Term CreateTerm (string name, int lcid);
Public Function CreateTerm (name As String, lcid As Integer) As Term
Parameters
name
String String String

Default label for the lcid

lcid
Int32 Int32 Int32

LCID to create the label on

Returns

The newly created Term object

Exceptions

The user does not have sufficient permission to perform this operation.

Keyword term set only allows a flat list of Terms.

The name is not valid, it contains invalid characters or is too long.

The name is a null reference (Nothing in Visual Basic) or empty string.

Remarks

If the Microsoft.SharePoint.TaxonomyTermSet object for this TaxonomyItem is not an open TermSet then the current user must have EditTerm permissions in order to use this method.

If the specified lcid is not the default language of the TermStore, a Label with the name and the default language of the TermStore will also be created to ensure the Term has a default Label for the default language of the TermStore.

If the current TermSetItem is the Keyword Term Set, then label is always created for the term store default language.

The name value will be normailized to trim consecutive spaces into one and replace the & character with the wide character version of the character (\uFF06). The leading and trailing spaces will be trimmed. It must be non-empty and cannot exceed 255 characters, and cannot contain any of the following characters ; "<>|&tab.

The current user will be set as the owner of the new Term.

CreateTerm(String, Int32, Guid) CreateTerm(String, Int32, Guid) CreateTerm(String, Int32, Guid)

Creates a new Term object below this Microsoft.SharePoint.TaxonomyItem object.The name is the default Label for the specified LCID.

public:
 Microsoft::SharePoint::Taxonomy::Term ^ CreateTerm(System::String ^ name, int lcid, Guid newTermId);
[Microsoft.SharePoint.Client.ClientCallableMethod(ClientLibraryTargets=Microsoft.SharePoint.Client.ClientLibraryTargets.NonRESTful, ReturnObjectIdentity=true)]
public Microsoft.SharePoint.Taxonomy.Term CreateTerm (string name, int lcid, Guid newTermId);
Public Function CreateTerm (name As String, lcid As Integer, newTermId As Guid) As Term
Parameters
name
String String String

Default label for the lcid

lcid
Int32 Int32 Int32

LCID to create the label on

newTermId
Guid Guid Guid

GUID for the term

Returns

The newly created Term object

Exceptions

The current user has insufficient permissions to perform this operation.

Keyword term set only allows a flat list of Terms.

The name is not valid, it contains invalid characters, or is too long.

The name is a null reference (Nothing in Visual Basic) or empty string.

Remarks

If the specified LCID is not the default language of the TermStore, a Label with the name and the default language of the TermStore will also be created to ensure the Term has a default Label for the default language of the TermStore.

If the current TermSetItem is the Keyword Term Set, then label is always created for the term store default language.

The name value will be normailized to trim consecutive spaces into one and replace the & character with the wide character version of the character (\uFF06). The leading and trailing spaces will be trimmed. It must be non-empty and cannot exceed 255 characters, and cannot contain any of the following characters ;"<>|&tab

The current user will be set as the owner of the new Term.

If the newTermId already exists in the TermStore, an exception will be thrown.

If the TermSet for this TaxonomyItem is not an open TermSet then the current user must have TaxonomyRights.EditTerm permission to use this method. CommitAll() must be called to save this change to the database.

Applies to