Saturday 28 May 2016

CSOM:TaxonomyFieldValueCollection returns null

Recently I came across a weird issue while reading TaxonomyField using Client Side Object Model.
I was using the below legacy and full proof working code for reading the value from ListItem
TaxonomyFieldValueCollection taxFieldValueColl = oitem[column] as TaxonomyFieldValueCollection;
I never had issues while using this code, but once this started and became nightmare for me.
Strange part was that same code use to work on removing and adding the dll reference of "Microsoft.SharePoint.Client.Taxonomy" only for the first time.
Believe I was not able to google it also as I don't even know which keyword I should use.

But finally I found one article here which really helped me lot and resolved my issue.
I would really urge to visit the above link and read it.
It was just a matter of using below code.
TaxonomyItem dummy = new TaxonomyItem(clientContext,null); 

No comments:

Post a Comment