TermSet.GetTermsWithCustomProperty Method (String, Boolean)
Gets a collection of Term objects with a property that has 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 TermSet
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
customPropertyName
Type: System.StringThe custom property name
trimUnavailable
Type: System.BooleanA Boolean indicating whether to trim out Term objects that have the IsAvailableForTagging property set to false.
Return Value
Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of Term objects with a property with the provided property name.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The customPropertyName cannot be a null reference (Nothing in Visual Basic) or empty. |
ArgumentException | The value of customPropertyName is invalid. It probably contains invalid characters or is too long. |
Remarks
If trimUnavailable is true, then Term objects with the IsAvailableForTagging property set to false will be trimmed from the results; otherwise all matching terms will be returned regardless of their IsAvailableForTagging property value.The customPropertyName cannot be a null reference (Nothing in Visual Basic) 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, Microsoft recommends using the CommitAll() to commit changes to the database before executing this search.
See Also
Reference
GetTermsWithCustomProperty Overload
Microsoft.SharePoint.Taxonomy Namespace
GetTermsWithCustomProperty(String, Int32, Boolean)
GetTermsWithCustomProperty(String, String, Boolean)
GetTermsWithCustomProperty(String, String, StringMatchOption, Boolean)
GetTermsWithCustomProperty(String, String, StringMatchOption, Int32, Boolean)