Using SncTriggerSynchronizer in scoped application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 06:22 PM
I have a Custom Application in Global scope that uses SncTriggerSynchronizer. I'm working on to convert this application to be in its own scope but looks like this API is no more available in scoped applications.
Is there a way I can achieve the same in scoped application?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 06:50 PM
Hi Vipin,
You may find the below thread helpful.
Re: Triggering executing a scheduled job when configuring an app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 07:27 PM
Thanks for the reply Pradeep. Actually I'm already using the method, described in the link, to create and invoke a scheduled job.
//Execute a scheduled script job
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
SncTriggerSynchronizer.executeNow(rec);
However the problem is that this method doesn't seem to work in scoped application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 01:43 AM
Hi there, faced exactly the same problem. As far as I know, the only option to execute a Scheduled job from private scope is to create a script include against GLOBAL scope and execute that included class method from private scope. Something like this:
Go to System Definition -> Script Includes. Create new script against global scope, call it whatever you like. Sample class:
var RequestsUtils = Class.create();
RequestsUtils.prototype = {
initialize: function() {
},
performImport : function(sys_id) {
gs.log('[Script include - RF Utils] Executing scheduled job with sys id - ' + sys_id);
SncTriggerSynchronizer.executeNow(sys_id);
},
type: 'RequestsUtils'
};
And then in your script where you want to execute scheduled job:
var utils = new global.RequestsUtils();
utils.performImport();
Works for us, hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 07:25 AM
Thanks a lot Tomasz, I'll give this a try and update.