Partilhar via


TermSetItem.ReuseTerm Method

Creates a new reused Term object below this TaxonomyItem object based on a sourceTerm.

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

Syntax

'Declaration
Public Function ReuseTerm ( _
    sourceTerm As Term, _
    reuseBranch As Boolean _
) As Term
'Usage
Dim instance As TermSetItem
Dim sourceTerm As Term
Dim reuseBranch As Boolean
Dim returnValue As Term

returnValue = instance.ReuseTerm(sourceTerm, _
    reuseBranch)
public Term ReuseTerm(
    Term sourceTerm,
    bool reuseBranch
)

Parameters

Return Value

Type: Microsoft.SharePoint.Taxonomy.Term
The newly created reused Term

Exceptions

Exception Condition
UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

TermStoreOperationException

This operation is invalid in the Orphaned Terms term set.The operation failed.

TermStoreOperationException

Keywords are not allowed to be reused.

TermStoreOperationException

Reusing a deprecated Term is disallowed.

TermStoreOperationException

Terms can not be shared multiple times in the same term set

TermStoreOperationException

The target term set can not be the Keywords term set or the orphaned terms term set.

TermStoreOperationException

This operation is invalid in the Orphaned Terms term set.The operation failed.

ArgumentNullException

The source Term is a null reference (Nothing in Visual Basic) or invalid

Remarks

Reuse a term from a different term set to become a child of the current TermSetItem. The target term set cannot be the Keyword or Orphaned Term Set. Keywords cannot be reused.

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

See Also

Reference

TermSetItem Class

TermSetItem Members

Microsoft.SharePoint.Taxonomy Namespace