Domanda

Impossibile trovare questo documentato da nessuna parte.Cambio solo il termine e correre un commit di tutti nel corridoio?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top