ServiceNow Things to Know 51: Apply template in Scoped Application
Import
·
Dec 27, 2023
·
article
Did you know you can apply template within a scoped application?
Here is an example:
var sys_id_of_template = ''; // provide here the sys_id of the template record
var grObj = new GlideRecord(''); // provide here the table on which you wish to apply the templategrObj.initialize(); var t = new GlideTemplate.get(sys_id_of_template); t.apply(grObj);
grObj.insert();
View original source
https://www.servicenow.com/community/developer-blog/servicenow-things-to-know-51-apply-template-in-scoped/ba-p/2774369