Share via


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)

Syntax

'Declaration
Public Overrides Sub SetCustomProperty ( _
    name As String, _
    value As String _
)
'Usage
Dim instance As Term
Dim name As String
Dim value As String

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

Parameters

  • value
    Type: System.String

    the value to set for the specified custom property

Exceptions

Exception Condition
UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

TermStoreOperationException

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

ArgumentException

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

ArgumentNullException

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

Remarks

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

Reference

Term class

Term members

Microsoft.SharePoint.Taxonomy namespace