Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I has a ListItem with TaxonomyField which has some value in it (some term of course). This TaxonomyField is single value only. So now I want to set it to empty, just as it was from the beginning, but I can't find the way to do it. What I has tried so far:

listItem.ParseAndSetFieldValue(taxField.InternalName, String.Empty);

It doesn't throw any exception on ClientContext.Update(), but field value for listItems stays unchanged.

taxField.SetFieldValueByValue(listItem, new TaxonomyFieldValue());

This gives me "The method or operation is not implemented." Exception

listItem["taxField.InternalName"]=string.Empty;

This also runs without exceptions, but value stays the same. BTW do use such approach, use ParseAndSetFieldValue instead.

So could any one suggest something that would done a trick? Thanks in advance!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Here is solution:

taxField.ValidateSetValue(listItem, null);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.