MetadataDefaults.GetDefaultMetadata method (String)

Gets the defaults for all fields in a specified SPFolder that have defaults.

Namespace:  Microsoft.Office.DocumentManagement
Assembly:  Microsoft.Office.DocumentManagement (in Microsoft.Office.DocumentManagement.dll)

Syntax

'Declaration
Public Function GetDefaultMetadata ( _
    folderPath As String _
) As Pair()
'Usage
Dim instance As MetadataDefaults
Dim folderPath As String
Dim returnValue As Pair()

returnValue = instance.GetDefaultMetadata(folderPath)
public Pair[] GetDefaultMetadata(
    string folderPath
)

Parameters

  • folderPath
    Type: System.String

    The server-relative path of the folder to get defaults for

Return value

Type: []
All of the location-based field defaults set at folderPath parameter in an array of pairs.

Exceptions

Exception Condition
ArgumentNullException

The folderPath parameter is set to a null reference (Nothing in Visual Basic) or set to String.Empty. The folderPath parameter should be a server-relative URL that links to a SPFolder object in the document library.

(ArgumentNullException.ParamName="folderPath")

Remarks

The first value of each pair is the field on which the default value exists. The second value in the pair is the default value on that field at passed-in parameter's folderPath.

Examples

SPSite site = new SPSite("http://contoso"); SPWeb web = new site.OpenWeb("/"); MetadataDefaults defaults = MetadataDefaults("/Documents", web); Pair[] fieldDefaults = defaults.GetDefaultMetadata("/Documents/AdventureWorks");

See also

Reference

MetadataDefaults class

MetadataDefaults members

GetDefaultMetadata overload

Microsoft.Office.DocumentManagement namespace

MetadataDefaults