I'm working on Sitecore 6.6. I wan to get all the fields for a particular item.
I'm getting all the fields using this
FieldCollection fieldcollection = Sitecore.Context.Database.GetItem(Id, LanguageManager.GetLanguages(Sitecore.Context.Database).Where(i => i.CultureInfo.ToString() == Globallanguage).FirstOrDefault(), Sitecore.Data.Version.Latest).Fields;
And looping through each field and adding items to a list
foreach (Field field in fieldcollection)
{
if(fields!=null)
{
.....
}
}
But after returning some fields it is throwing me an error
Object reference not set to an instance of an object. at Code.Pipeline.NotFoundRedirector.GetAllMappedUrls()
I wanted to know whether I'm using correct method to get all fields
I have got all the fields by changing the version and adding getall() method
The loop goes as usual