How to apply a template using a script

object.applyTemplate(“template_name”);

Example – Create new record and apply a template:

var inc = new GlideRecord("incident");
inc.initialize();
inc.applyTemplate("TemplateName");
inc.insert();

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/form-administration/reference/r_ScriptedTemplates.html

Latest Posts

Discover more from mySNstuff.com

Subscribe now to keep reading and get access to the full archive.

Continue reading