Adding an "Apply Template" Button

turnea
Mega Expert


Hi everyone,

 

As a part of an update, we looking to add an "Apply Template" button to our Incident form.   We want it to work exactly like our context menu but wanted more visibility.   The problem is that I can't seem to track down where the "Apply Template" (or "Template" for that matter) context menu section is.   I've searched through several areas including UI Context Menus and UI Actions but no avail.   Any idea where it is?   Am I missing something glaringly obvious?

 

Thank you!

Amandah

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

Unfortunately, that code is buried inside the ui macro 'template_context' script and it's not a UI Action or even a UI Context menu, so you would have to build a UI Action that fires something similar to that



You could take a look at the script there and see if you can replicate it in a UI Action or what you could do is select a template in a reference field, then have a UI Action that calls the script in the wiki link below to 'Apply the Template'.



Creating a Template - ServiceNow Wiki


View solution in original post

2 REPLIES 2

marcguy
ServiceNow Employee
ServiceNow Employee

Unfortunately, that code is buried inside the ui macro 'template_context' script and it's not a UI Action or even a UI Context menu, so you would have to build a UI Action that fires something similar to that



You could take a look at the script there and see if you can replicate it in a UI Action or what you could do is select a template in a reference field, then have a UI Action that calls the script in the wiki link below to 'Apply the Template'.



Creating a Template - ServiceNow Wiki


camds
Kilo Expert

Hi Amandah,



Mark Stanger (Crossfuze) Has a great solution for advance use of the templates functions (including details on a Apply Template UI Action) on the SNCGuru site here http://www.servicenowguru.com/system-definition/advanced-templates/



Cheers,


Cameron