Using SncTriggerSynchronizer in scoped application.

vks
Kilo Expert

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?

8 REPLIES 8

This seem to work but partially. I'm now able to invoke SncTriggerSynchronizer.executeNow however (1) neither does my job start executing (2) nor does the control returns to my calling script.



No error in logs. I added a try-catch but no exception either.


vks
Kilo Expert

Well, calling global Scheduled Data Import from within private scope was not desired by my team. Fortunately I was able to find a way.



I now create a Scheduled Data Import record as part of scoped application and invoke it as follows:



gs.executeNow(myScheduledDataImportRecord);



Based on my requirements, I also create a Data Source record as part of application. I then 'utilize' these two resources (records) to execute imports.



Cheers,


Vipin


Ankush13
Kilo Guru

I was able to get this done in scope using below:

var rec = new GlideRecord('sysauto_script');
rec.get('name', '<name-of-scheduled-job-to-trigger>');
gs.executeNow(rec);

VaranAwesomenow
Mega Sage

I learned tat the action that triggers SncTriggerSynchronizer should remain in global scope and it can be called in scoped app flows / subflows.