1

I'm trying to change the property "IsAvailableForTagging" to false from some terms using JSOM, but when i try Term.IsAvailableForTagging = false or Term.IsAvailableForTagging = 'false' nothing happens, even errors not appears but still available for tagging. It's possible to change?

Thanks

I FOUND A SOLUTION TO MY PROBLEM.

let context = SP.ClientContext.get_current();
let taxonomy = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);
let termStores = taxonomy.get_termStores();
let termStore = termStores.getByName('Store Name');
let termSet = termStore.getTermSet('Set Id');
let terms = termSet.getAllTerms();

context.load(terms, 'Include(Id, IsRoot, Labels, TermsCount, Name, PathOfTerm, Parent.Id, Parent.Name, IsAvailableForTagging, TermSet.Name)');

context.executeQueryAsync(()=>{
    const enumerator = terms.getEnumerator();
    
    while(enumerator.moveNext()){
         current = enumerator.get_current();

         // current.get_isAvailableForTagging this returns the status os tagging
         current.set_isAvailableForTagging(false) //this worked for me
       
    }

});
3
  • Can you provide an example of your code? For example, we need to use if you execute the executeQueryAsync() function Apr 7, 2021 at 1:57
  • Sure, the code is available now, thanks. Apr 7, 2021 at 10:43
  • I found a solution, thanks for your atention. Apr 8, 2021 at 12:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.