Partilhar via


TaxonomySession.GetTermsWithCustomProperty Method (String, Boolean)

Gets Term objects from all TermStore objects that have a property with the provided property name.

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

Syntax

'Declaration
Public Function GetTermsWithCustomProperty ( _
    customPropertyName As String, _
    trimUnavailable As Boolean _
) As TermCollection
'Usage
Dim instance As TaxonomySession
Dim customPropertyName As String
Dim trimUnavailable As Boolean
Dim returnValue As TermCollection

returnValue = instance.GetTermsWithCustomProperty(customPropertyName, _
    trimUnavailable)
public TermCollection GetTermsWithCustomProperty(
    string customPropertyName,
    bool trimUnavailable
)

Parameters

  • trimUnavailable
    Type: System.Boolean

    yes if it trims away the unavailable Term objects from the result collection; no if it includes the unavailable Term objects in the result collection.

Return Value

Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of Term objects

Exceptions

Exception Condition
ArgumentException

Property name is invalid

Remarks

Only TermSet objects.that are not scoped to a SPSite object and TermSet objects.that are scoped to current site are searched.

The maximum number of returned Term objects from each TermStore is 100.

The search results are directly from the TermStore object. It may not be synchronized with changes that have been made but not committed. For best results, call the CommitAll method or call the RollbackAll method before calling this method.

See Also

Reference

TaxonomySession Class

TaxonomySession Members

GetTermsWithCustomProperty Overload

Microsoft.SharePoint.Taxonomy Namespace