Versions Compared

Key

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

...

Apply the template instead of applying the comments.  Technically both could be done.

Code Block
languagejs
...
	//Check to make sure the field is there:
    var isFieldHere = (g_form.getControl('u_kb_article_template') != null);	
...
	// Apply template with or without tasks.  Will need to make sure to use the script include that helps determine if there's a task or not
    function kbCallback(kbArt){
		if (kbArt.next()){
			var template = kbArt.u_template
			//applyTemplate(template);
			
			// If we have tasks on our template
			g_form.setValue('u_kb_article_template',kbArt.sys_id)	
			g_form.checkMandatory = false;
            gsftSubmit(null, g_form.getFormElement(), 'apply_my_template');
			
			/*
			var currComm = g_form.getValue('comments');
			if (currComm != '')
				currComm += '\n\n';
			g_form.setValue('comments', currComm + '[code]' + kbArt.text + '[/code]');
 			*/
		}
	}