Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TermStore.GetTermsWithCustomProperty method (String, Boolean)

This method retrieves a collection of all Term objects, from all TermSets in this TermStore that the current user has permissions to read, that have a custom property with the provided property name.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)
public TermCollection GetTermsWithCustomProperty(
	string customPropertyName,
	bool trimUnavailable
)

Parameters

customPropertyName
Type: System.String

The custom property name

trimUnavailable
Type: System.Boolean

A boolean indicating whether to trim out terms that have Term.IsAvailableForTagging set to false.

Return value

Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of all Term objects, from all TermSets in this TermStore that the current user has permissions to read, that have a custom property with the provided property name.
ExceptionCondition
ArgumentNullException

The customPropertyName cannot be null or empty.

ArgumentException

The value of customPropertyName is invalid. It probably contains invalid characters or is too long.

If trimUnavailable is true then terms that have Term.IsAvailableForTagging set to false will be trimmed from the results; otherwise all matching terms will be returned regardless of their Term.IsAvailableForTagging value. The customPropertyName cannot be null or empty, and must not exceed 255 characters in length. It also cannot contain any of the following illegal characters ; " < > | & tab The search is case-insensitive. A maximum of 100 results will be returned from this search. To get the most accurate results it is recommended that any pending changes be committed to the database using CommitAll() prior to executing this search.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.