applyTemplate() method not available in scoped applications
This content was last updated in 2020. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2016 06:31 AM
I'm writing a custom application in the Fuji release, which requires scoped applications. When I try to use the applyTemplate() method in an OnSubmit Business Rule, I receive an error stating that this method is not supported in scoped applications. Any ideas?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 05:40 AM
Hi
I'm trying to do the same thing for a change template.
But is not wokring.
var change = new GlideRecord('change_request');
var template = new GlideRecord('std_change_record_producer');
var sys_id;
template.addQuery('name', 'STD Change - Scanning Network for IP Blackholing');
template.query();
if(template.next()){
sys_id = template.sys_id;
}
change.initialize();
GlideTemplate.get(sys_id).apply(change);
Could you help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2020 01:59 AM
Create Include ScopedAppWorkarounds - https://community.servicenow.com/community?id=community_blog&sys_id=72b0f06adb3d33801cd8a345ca96194d...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2020 11:41 PM
This worked for me:
var grChange= new GlideRecord('change_request');
grChange.initialize();
grChange.setValue('type', 'standard');
var scSNC = new global.StandardChangeProcessSNC(grChange);
scSNC.applyTemplate('Reboot Windows Server');
grChange.insert();