MetadataDefaults.RemoveAllFieldDefaults method (String)

Removes all of the default values that are set at a specified location.

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

Syntax

'Declaration
Public Function RemoveAllFieldDefaults ( _
    folderPath As String _
) As Boolean
'Usage
Dim instance As MetadataDefaults
Dim folderPath As String
Dim returnValue As Boolean

returnValue = instance.RemoveAllFieldDefaults(folderPath)
public bool RemoveAllFieldDefaults(
    string folderPath
)

Parameters

  • folderPath
    Type: System.String

    The server-relative path to the location from which to remove the defaults

Return value

Type: System.Boolean
true if successful, otherwise, false

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 in the document library.

(ArgumentNullException.ParamName="folderPath")

Remarks

Removes the default values set on all of the fields at the location specified by the folderPath parameter.

Examples

SPSite site = new SPSite("http://contoso"); SPWeb web = new site.OpenWeb("/"); MetadataDefaults defaults = MetadataDefaults("/Documents", web); defaults.RemoveAllFieldDefaults("/Documents/AdventureWorks"); defaults.Update();

See also

Reference

MetadataDefaults class

MetadataDefaults members

RemoveAllFieldDefaults overload

Microsoft.Office.DocumentManagement namespace

MetadataDefaults