Term.SetCustomProperty method

Adds a new custom property or updates the value of an existing property

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)


Public Overrides Sub SetCustomProperty ( _
    name As String, _
    value As String _
Dim instance As Term
Dim name As String
Dim value As String

instance.SetCustomProperty(name, value)
public override void SetCustomProperty(
    string name,
    string value


  • value
    Type: System.String

    the value to set for the specified custom property


Exception Condition

The current user has insufficient permissions to perform this operation.


This operation is invalid in the orphaned terms TermSet.The operation failed.


The custom property name is not valid. It contains invalid characters or is too long.


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


This method tries to find the specified custom property name and set it with the specified value. The name match is not case-sensitive. If the custom property name does not exist, then a new property is created.

The name must be non-empty, cannot exceed 255 characters, and cannot contain any of the following characters: ;"<>|&tab

The value cannot exceed 1000 characters.

The leading and trailing space of the custom property name and value will be trimmed.

The current user must have TaxonomyRights.EditTerm permission to use this method. Call the CommitAll() method to save this change to the database.

See also


Term class

Term members

Microsoft.SharePoint.Taxonomy namespace