<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to remove standard from the article template in newyork? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729816#M386742</link>
    <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="4abea383db93eb009a64e15b8a96197b"&gt;@Rahul Gupta&lt;/SN-MENTION&gt;, I'm not sure if you are still having issues with this but I was also having trouble with this and managed to find a working solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within the ArticleTemplateUtil script include, you can add a method that overrides the getArticleTemplatesForKnowledgeBase method in the ArticleTemplateUtilSNC script.&lt;/P&gt;
&lt;P&gt;Within the ArticleTemplateUtil script, the code is as follows:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var ArticleTemplateUtil = Class.create();
        ArticleTemplateUtil.prototype = Object.extendsObject(ArticleTemplateUtilSNC,{
			
			// script override to disable Standard KB template
			getArticleTemplatesForKnowledgeBase: function(kbId, addNames) {
				var gr = new GlideRecord('kb_template_m2m_knowledge_base');
				gr.addQuery('kb_knowledge_base',kbId);
				gr.query();

				var templates = {};
				if(!addNames)
					templates['kb_knowledge'] = true;
				
				if(!gr.hasNext()){
					var template = new GlideRecord('kb_article_template');
					template.addActiveQuery();
					template.query();
					while(template.next()){
						if(addNames)
							templates[template.child_table] = template.getDisplayValue('article_template');
						else
							templates[template.child_table] = true;
					}
					return templates;
				}
				else {
					while(gr.next()){
						if(gr.kb_article_template.active){
							if(addNames)
								templates[gr.kb_article_template.child_table] = gr.kb_article_template.getDisplayValue();
							else
								templates[gr.kb_article_template.child_table] = true;
						}
					}
				}
				return templates;
				},
			// --
			
        type: 'ArticleTemplateUtil'
        });&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hopefully this helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2020 18:26:38 GMT</pubDate>
    <dc:creator>JayGervais</dc:creator>
    <dc:date>2020-01-10T18:26:38Z</dc:date>
    <item>
      <title>How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729812#M386738</link>
      <description>&lt;P&gt;I wanted to remove the standard option from the &lt;STRONG&gt;select article template&lt;/STRONG&gt; under &lt;STRONG&gt;knowledge&lt;/STRONG&gt; category .&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/204608iB3E194703872F4F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please help me .!!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 13:17:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729812#M386738</guid>
      <dc:creator>Rahul Gupta</dc:creator>
      <dc:date>2019-11-17T13:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729813#M386739</link>
      <description>&lt;P&gt;&lt;SPAN class="ph menucascade"&gt;&lt;SPAN class="ph uicontrol"&gt;go to Knowledge&lt;/SPAN&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;SPAN class="ph uicontrol"&gt;Administration&lt;/SPAN&gt;&amp;nbsp;&amp;gt;&amp;nbsp;&lt;SPAN class="ph uicontrol"&gt;Article Templates&lt;/SPAN&gt;&lt;/SPAN&gt;. and set the active to false for standard&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark correct if this helps&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 14:37:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729813#M386739</guid>
      <dc:creator>RudhraKAM</dc:creator>
      <dc:date>2019-11-17T14:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729814#M386740</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Deactivating knowledge article templates :&lt;/P&gt;
&lt;P&gt;You cannot delete an article template because article templates have an associated child table. Deleting a template would also require deleting the child table. Due to the limitations on dropping tables, article templates and template columns are explicitly made non-deletable. Instead you can disable the Knowledge Article Templates feature by clearing the&amp;nbsp;&lt;STRONG&gt;Active&lt;/STRONG&gt;&amp;nbsp;check box on the Article Template form.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 03:15:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729814#M386740</guid>
      <dc:creator>Krishna  Penaka</dc:creator>
      <dc:date>2019-11-18T03:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729815#M386741</link>
      <description>&lt;P&gt;Standard isn't an option there. You could do this in the old view by editing the interceptor but can't in NY+&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 13:45:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729815#M386741</guid>
      <dc:creator>Igor1</dc:creator>
      <dc:date>2019-12-18T13:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729816#M386742</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="4abea383db93eb009a64e15b8a96197b"&gt;@Rahul Gupta&lt;/SN-MENTION&gt;, I'm not sure if you are still having issues with this but I was also having trouble with this and managed to find a working solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within the ArticleTemplateUtil script include, you can add a method that overrides the getArticleTemplatesForKnowledgeBase method in the ArticleTemplateUtilSNC script.&lt;/P&gt;
&lt;P&gt;Within the ArticleTemplateUtil script, the code is as follows:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var ArticleTemplateUtil = Class.create();
        ArticleTemplateUtil.prototype = Object.extendsObject(ArticleTemplateUtilSNC,{
			
			// script override to disable Standard KB template
			getArticleTemplatesForKnowledgeBase: function(kbId, addNames) {
				var gr = new GlideRecord('kb_template_m2m_knowledge_base');
				gr.addQuery('kb_knowledge_base',kbId);
				gr.query();

				var templates = {};
				if(!addNames)
					templates['kb_knowledge'] = true;
				
				if(!gr.hasNext()){
					var template = new GlideRecord('kb_article_template');
					template.addActiveQuery();
					template.query();
					while(template.next()){
						if(addNames)
							templates[template.child_table] = template.getDisplayValue('article_template');
						else
							templates[template.child_table] = true;
					}
					return templates;
				}
				else {
					while(gr.next()){
						if(gr.kb_article_template.active){
							if(addNames)
								templates[gr.kb_article_template.child_table] = gr.kb_article_template.getDisplayValue();
							else
								templates[gr.kb_article_template.child_table] = true;
						}
					}
				}
				return templates;
				},
			// --
			
        type: 'ArticleTemplateUtil'
        });&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hopefully this helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 18:26:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729816#M386742</guid>
      <dc:creator>JayGervais</dc:creator>
      <dc:date>2020-01-10T18:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729817#M386743</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="fd913590dbd9cc9013b5fb24399619bd"&gt;@JayGervais&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the code you suggested but i keep getting this error. I am not sure what i am doing wrong. Please help. Thanks.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var ArticleTemplateUtil = Class.create();
ArticleTemplateUtil2.prototype = Object.extendsObject(ArticleTemplateUtil2SNC,{
	
		// script override to disable Standard KB template
			getArticleTemplatesForKnowledgeBase: function(kbId, addNames) {
				var gr = new GlideRecord('kb_template_m2m_knowledge_base');
				gr.addQuery('kb_knowledge_base',kbId);
				gr.query();

				var templates = {};
				if(!addNames)
					templates['kb_knowledge'] = true;
				
				if(!gr.hasNext()){
					var template = new GlideRecord('kb_article_template');
					template.addActiveQuery();
					template.query();
					while(template.next()){
						if(addNames)
							templates[template.child_table] = template.getDisplayValue('article_template');
						else
							templates[template.child_table] = true;
					}
					return templates;
				}
				else {
					while(gr.next()){
						if(gr.kb_article_template.active){
							if(addNames)
								templates[gr.kb_article_template.child_table] = gr.kb_article_template.getDisplayValue();
							else
								templates[gr.kb_article_template.child_table] = true;
						}
					}
				}
				return templates;
				},
			// --
			
        type: 'ArticleTemplateUtil'
        });
	
// My original code starts here
getFieldsForTemplate: function(){
		var template = this.getParameter("sysparm_template");
		var fields = this.getFieldsDataForTemplate(template);
		var result = {
			fields: fields,
			template: template
		};
		return JSON.stringify(result);
	},

	getFieldsDataForTemplate: function(template){
		var fields = [];

		if(template == 'kb_knowledge'){
			fields.push( {
				field: '',
				type: 'HTML'
			});
			return fields;
		}

		var gr = new GlideRecord('kb_article_template_definition');
		gr.addQuery('article_template.child_table',template);
		gr.addActiveQuery();
		gr.orderBy('order');
		gr.query();

		while(gr.next()){
			var collapsible, collapsed, collapse_type = gr.getValue('collapsible');
			if(collapse_type == 'expanded'){
				collapsible = true;
				collapsed = false;
			} else if(collapse_type == 'collapsed') {
				collapsible = true;
				collapsed = true;
			} else {
				collapsible = false;
				collapsed = false;
			}
			fields.push( {
				field: gr.getDisplayValue('column_label'),
				type: gr.getDisplayValue('column_type'),
				column: gr.getValue('table_column'),
				collapsible: collapsible,
				collapsed: collapsed,
				heading_style: gr.getDisplayValue('heading_style'),
				field_style: gr.getDisplayValue('field_style'),
				preview_text: gr.getValue('u_preview_text'), //Added to see the Preview Text on the kb_knowledge_create_template_preview ui macro
			});
		}

		return fields;
	},
	
	type: 'ArticleTemplateUtil'
});

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 15:43:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729817#M386743</guid>
      <dc:creator>Isreal</dc:creator>
      <dc:date>2021-07-08T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729818#M386744</link>
      <description>&lt;P&gt;Hey there,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What error are you getting and where did you add the code script?&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jul 2021 17:41:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729818#M386744</guid>
      <dc:creator>JayGervais</dc:creator>
      <dc:date>2021-07-08T17:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729819#M386745</link>
      <description>&lt;P&gt;Thanks &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="fd913590dbd9cc9013b5fb24399619bd"&gt;@JayGervais&lt;/SN-MENTION&gt;&amp;nbsp;!!&lt;/P&gt;
&lt;P&gt;This helped !&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 12:41:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729819#M386745</guid>
      <dc:creator>Juilee</dc:creator>
      <dc:date>2021-07-14T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729820#M386746</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We had the same requirement, we could remove it from the ui for a particular knowledge base however how to achieve the same for the workspace view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;UD&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 13:40:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/1729820#M386746</guid>
      <dc:creator>urmilla</dc:creator>
      <dc:date>2021-08-12T13:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/2727171#M1052500</link>
      <description>&lt;P&gt;Any idea how to make this happen?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 20:02:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/2727171#M1052500</guid>
      <dc:creator>mahi4889Snow</dc:creator>
      <dc:date>2023-11-08T20:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/3002747#M1133808</link>
      <description>&lt;P&gt;Hello Urmilla,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the same requirement to remove Standard from particular knowledge base but above script does for all all.&amp;nbsp; How did you manage?&amp;nbsp; please advise.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gita&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 20:26:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/3002747#M1133808</guid>
      <dc:creator>singhalgita</dc:creator>
      <dc:date>2024-07-29T20:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove standard from the article template in newyork?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/3539521#M1255028</link>
      <description>&lt;P&gt;Hello, how to change order in the select article template?&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 02:40:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-remove-standard-from-the-article-template-in-newyork/m-p/3539521#M1255028</guid>
      <dc:creator>lsaulon</dc:creator>
      <dc:date>2026-05-08T02:40:28Z</dc:date>
    </item>
  </channel>
</rss>

