I'm having some troubles with filling a TagTreelist field programmatically. I simply tried the same as for treelist fields as i know it works:
string tagID = Search.GetYearTagItem(year, "/sitecore/content/ORV/Websites/Global/Sanofi COM/Data/Tags", "Feature/Experience Accelerator/Taxonomy/Datasource/Tag").ToString(); // returns me the item ID to insert in the treelist Sitecore.Diagnostics.Log.Error("DebugA:"+tagID, this); // this returns me the right ID. item.Fields["Tags"].Value = tagID;// string : ids separated by pipes
But it seems to work differently with TagTreelist because i got the following error :
Object reference not set to an instance of an object
Does anyone know what type my object is supposed to receive ?
Thank you for your help
EDIT 1: i confirm you if i remove this line :
item.Fields["Tags"].Value = // string : ids separated by pipes
the error disappears. The problem definitely comes from the line i guess.