applyTemplate() method not available in scoped applications

cmcclendon
Mega Guru

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.

7 REPLIES 7

Hi @Paul Morris ,

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?

Community Alums
Not applicable

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();