Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2025 06:05 AM
It also works in a custom scope and in a Script Include that is used for other things and has more functions. Nice solution!
Example:
var CustomTemplateUtil = Class.create();
CustomTemplateUtil.prototype = {
getAvailableTemplates: function(tableName, recordSysId) {
// ...
},
applyTemplate: function(recordSysId, templateSysId) {
// ...
},
/**
* Returns the table names available for the table selection field on the form.
* ! Attention: Do not change this function name. It is used by the internal ServiceNow logic.
*/
process: function() {
var tableNames = ['x_custom_request', 'x_custom_task', 'x_custom_project'];
return tableNames;
},
type: 'CustomTemplateUtil'
};