Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

ProcessBatchData doesn't work when updating Managed Metadata field in a list

$
0
0

I am trying to insert items in bulk in a list using ProcessBatchData in C# and one of the field is called "Department" whose type is "Managed Metadata". I am facing very strange issue which is below. (screenshots given below)

1. When I put a break point and hover .WssId then it shows value -1

2. When I hover taxonomyFieldValue and then click on that arrow to view its detail then I can see that WssId has some value for e.g. 6

3. Now after that if I hover .WssId again then it shows correct value which is 6 and "Department" field is updated.

So to summarize if I don't place a break point and don't do above step then "Department" field remains blank i.e. (although item is inserted as I can see that other fields are populated) to successfully update data, I have to do step 2 above which is to hover taxonomyFieldValue and click on that arrow to view its detail. Simply hoveringtaxonomyFieldValue and not viewing its detail also doesn't work i.e. "Department" field remains blank (although item is inserted)

Using any other value for e.g. taxonomyFieldValue.Label or taxonomyFieldValue.TermGuid or taxonomyFieldValue or taxonomyFieldValue.ToString() instead of taxonomyFieldValue.WssId doesn't work at all as it doesn't even insert item in the list let alone updating "Department" field.

By the way if I use regular method i.e. insert item individually using SPListItem.Update() then the same code works perfectly (screenshot given below)

What is going on here?



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>