How can i set an taxonomyfield during an itemAdding event?
i've got a TaxonomyFieldValue created from my propertybag.
public override void ItemAdding(SPItemEventProperties properties)
{
//Get site and list we are working on
SPSite CurrentSite = properties.OpenSite();
using (SPWeb web = properties.OpenWeb())
{
TaxonomySession taxonomySession = new TaxonomySession(CurrentSite);
TaxonomyFieldValue taxvalue= new TaxonomyFieldValue(probertybagValue.ToString());
properties.AfterProperties["MyField"] = taxvalue.ToString();
}
base.ItemAdding(properties);
}
Normaly i would use Taxonomy SetFieldValue option, but this can only use with an SPItem object, and we haven't that object during itemAdding
