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

Can't find this documented anywhere. Do I just change the Term.Name and run a commit all on the term store?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes, that is the simplest way to do it. I have only found two ways to rename a term programmatically:

1) Set the Name property and CommitAll on the Term Store:

    var site = SPContext.Current.Site;
    var taxonomySession = new TaxonomySession(site);
    var termStore = taxonomySession.TermStores[0];
    var termGroup = termStore.Groups[0];
    var termSet = termGroup.TermSets[0];
    var term = termSet.Terms[0];
    term.Name = "Test Update";
    termStore.CommitAll();  

2) Create a new Term and then Merge it with the old one.

But you were on the right track. Go with option 1. Only thing to note is that it doesn't always update instantly. It can take a few seconds for the change to be reflected when you try to retrieve the term again.

share|improve this answer
    
Thanks a lot for your answer John. Yer, I believe there's a timer job to update any metadata terms. Thanks again. –  DeeMac Oct 12 '12 at 8:00

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.