I'm trying to set the metadata value for a folder in a document library with the following code:
using (SPSite siteCollection = new SPSite("http://dev.site.com"))
{
using (SPWeb web = siteCollection.OpenWeb())
{
SPList customDocumentLibrary = web.Lists["Program Documents"];
MetadataDefaults columnDefaults = new MetadataDefaults(customDocumentLibrary);
SPFolder testFolder = customDocumentLibrary.RootFolder.SubFolders["Programs"];
columnDefaults.SetFieldDefault("/Program Documents/Programs/Academics", "Programs", "Academics");
columnDefaults.Update();
}
}
I'm getting the following error:
The given value for a taxonomy field was not formatted in the required <int>;#<label>|<guid> format.
Does anyone have an example of how to pass in the parameters for SetFieldDefault()? I'm unsure what the int;#label is referring to in the error message (though I have the guid of the taxonomy field).