Question

I've added a new section containing a couple of new fields to an existing data template. The fields appear correctly when logged in as a normal user account.

However when accessing the fields using the API, item.Fields["FieldName"] always returns NULL.

Things I've tried:

  1. Publishing both the item and the corresponding data template
  2. Granting "Everyone" explicit read access to the fields (and field section).
  3. Confirmed that my dev instance is pointed to the correct database
  4. Debugging shows that my two new fields are not in the item's Fields collection.

I've also executed an iisreset, just in case something was cached somewhere. Any help would be much appreciated.

Was it helpful?

Solution

Try calling item.Fields.ReadAll() before accessing the field.

OTHER TIPS

Are you publishing and developing from the same sitecore instance? i've seen developers get frustrated by this b/c they are publishing from say, a development server, then looking for the field on their local dev box, which still has an old copy of the template cached. publishing on the dev server wouldn't clear the local cache in that case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top