Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is this?

...

glide.ui.permitted_tables

Add sys_template as a permitted table, otherwise people won't be able to see the templates to attach to the knowledge article.

Roles

template_editor, template_editor_group or template_editor_global must be granted to allow people to alter and view the templates as well.

...

Code Block
languagejs
var YaleAjax = Class.create();
YaleAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
	hasChildTemplates: function() {
		template = this.getParameter('sysparm_template');
		
		gr = new GlideRecord('sys_template');
		gr.get(template);
		
		if(gr.next != '' || gr.next_child != ''){
			// If there's child templates return true
			return true;
		}else{
			// There are no child templates
			return false;
		}
	},	
	_privateFunction: function() { // this function is not client callable
	
}
});

UI Action

This handles the case when there are tasks on the template and the record needed to be saved first.

Action Name : apply_my_template

https://yaledevelopment.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=b69b1d2d6fc082007ee2abcf9f3ee461

Code Block
languagejs
action.setRedirectURL(current);
current.applyTemplate(current.u_kb_article_template.u_template.name);
current.update();


References

https://community.servicenow.com/thread/143298

...