The SPListItem being updated was not retrieved with all taxonomy fields.
Table of Contents
Today I suddenly received the following error when I updated a list item with a taxonomy field:
The SPListItem being updated was not retrieved with all taxonomy fields.
In central admin there is a settingย that throttles the lookup return count, and Taxonomy fields are just lookups.
To fix this go to Central Administration, Manage Web Applications, selectย the web application, and then choose the dropdown under General Settings select Resource Throttling.
The setting for List View Lookup Threshold and raise it from the default 8. it can go up to 1000 although you are unlikely to need this many lookups.
Today I found a second reason and a 3rd reasonย why the same The SPListItem being updated was not retrieved with all taxonomy fields error might appear.
Solution
Option 1 – General typos
During my development I made some silly typos (happens sometimes) and my metadata field didn’t get deployed properly. The field existed but it wasn’t linked upย properly. As always some typos take a lot of time to correct them.
In this case the two fields (When you deploy a taxonomy field two fields are created; A TaxonomyFieldType and a Note field). The two fields need to be linked up using the TextField property on the TaxonomyFieldType field.
The weird thing is that when there are multiple taxonomy fields on an item only one taxonomy field needs to be incorrect to get all the taxonomy fields to generate the above error.
Option 2 – List and Web ID left behind
In the definition of the Taxononmy field a List and Web Id can be found when copying the field definitionsย with a tool like SharePoint Manager:
<FieldType=“TaxonomyFieldType” List=“{d42eb4ce-6521-4acd-983a-3ce1a44325e7}” WebId=“5eabab63-ca28-4bf4-a527-d5f8b4355c37“
When these two properties are left behind the same unclea “The SPListItem being updated was not retrieved with all taxonomy fields” error might appear again. This seems to eb the catch all error message for taxonomy fields.
So how should we deploy a taxonomy field then?
In my case I wanted to create an archive list which has a couple of metadata driven fields. One for box numbersย and one for Keywords.
So I firstย created the site columns for these two metadata fields (4 fields in total) in Visual Studio.
Then added the TaxonomyFieldTypeย fields to my content type
Then updated my list template’s schema.xml to include the 4 fields.
Finally I used some code to link the Taxonomy fields to the TermSets
One day I might update this article to include the full code but there seem to be a few articles around that do the same. One example
Discover more from SharePains
Subscribe to get the latest posts sent to your email.
Another reason this happens is if you change your provisioning methodology. i.e. we started using the standard sharepoint fields xml definitions being added via a feature. Then to leverage the new API mechanisms to auto create mapped and crawled properties we changes to using PowerShell with the SPFieldCollection.AddFieldAsXml method so we didn’t have to retype all our definitions. When you create a metadata field via the API you do not have to create the note field, SharePoint handles this for you.
Our list definitions that were previously configured still referenced the manually created note field instead of the new note field.
Therefore we had to go back and manually add this note field to the list definition to get it to work.
Hi Peter,
I have not tried that yet. After you ran into this problem did you change the Resource Throttling settings to get around the problem?
Thanks,
Pieter