0

how to get termset description using javascript. i get the term object but with not information about the description :

getTerm: function (termName,termId) {

    var ctx = SP.ClientContext.get_current();
    var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(ctx);
    var termStore = taxSession.getDefaultSiteCollectionTermStore();

    var termSets = termStore.getTermSetsByName(termName, 1033);  //Default Language

    var term = taxSession.getTerm(termId);
    ctx.load(termSets);
    ctx.load(term);
    ctx.executeQueryAsync(
        function () {
            console.log(term);
            console.log(String.format('Name: {0}', term.get_name()));
            console.log(termSets);
            //$('.tooltiptextF').innerText() = term;
        },
        function (sender, args) {
            console.log(args.get_message());
        });

}
  • 1
    it will be like term.get_description() – Gautam Sheth Jan 23 at 12:37
2

To get the description, you need to use it as term.get_description().

It is available as a method and not as property unfortunately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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