How to disable tags menu in the banner in knowledge form without using DOM

Not applicable

Hi All,

 

Sample snippet from onLoad client script which disables 'tags_menu' on banner in knowledge form but uses DOM manipulation which is not a best practice, so how to achieve this without using DOM.

 

Below is the code :

 

function onLoad() {
    var ga = new GlideAjax('gl_sc_script');
    ga.addParam('sysparm_name', 'getValueKbRel');
    ga.getXML(getRel);

    function getRel(response) {
        var answer = response.responseXML.documentElement.getAttribute("answer");
        if (g_form.getValue('workflow_state') == 'review') {
            g_form.hideRelatedList(answer);
        }
    }

    //Hide Tag on top of a Knowledge Article
    var e = document.getElementById("tags_menu");
    e.style.display = 'none';
}
3 REPLIES 3

Dr Atul G- LNG
Tera Patron

Hi @Community Alums 

 

Worth checking

 

https://www.servicenow.com/community/developer-articles/a-comprehensive-guide-to-disabling-tags-in-s...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0716486

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron

@Community Alums 

without DOM manipulation not possible.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@riyaz150819 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader