Export (0) Print
Expand All

TermStore.GetTerms method (String, Int32, Boolean)

Returns a collection of all Term objects from all TermSet objects in this TermStore that the current user has permissions to read with a label in the provided LCID matching the string provided.

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

public TermCollection GetTerms(
	string termLabel,
	int lcid,
	bool trimUnavailable
)

Parameters

termLabel
Type: System.String

The Label of the Term to get

lcid
Type: System.Int32

The locale identifier of the Term Labels to be matched.

trimUnavailable
Type: System.Boolean

A Boolean indicating whether to trim out terms that have the IsAvailableForTagging property set to false.

Return value

Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of all T:Microsoft.SharePoint.Taxonomy.Term objects from all TermSet objects in this TermStore object that the current user has permissions to read with a Label in the specified LCID that matches the string provided.

ExceptionCondition
ArgumentNullException

The termLabel cannot be a null reference (Nothing in Visual Basic) or empty.

ArgumentException

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

ArgumentOutOfRangeException

The lcid value must be one of the working languages in the current term store.

If trimUnavailable is set to true, then terms that have the IsAvailableForTagging set to false will be trimmed from the results; otherwise all terms will be returned regardless of their IsAvailableForTagging value. All Term.Labels in the language matching the lcid parameter will be searched by this method. The search is case-insensitive, and a maximum of 100 results will be returned. The termLabel 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 lcid value must be one of the working languages of the term store, specified by TermStore.Languages. 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.

Show:
© 2014 Microsoft