The CreatorCon Call for Content is officially open! Get started here.

SncTriggerSynchronizer.executeNow(rec); not working in scoped application

Deepthi13
Tera Expert

Hi team,

I am working in scoped application i want to execute a schedule job by using inbound action where this is not working in scoped

SncTriggerSynchronizer.executeNow(rec);

i am getting log 

gs.info("&&&1.4 ");
gs.info("&&&2 " + rec.run_as);
but i am not getting log -----
gs.info("&&&3 " + userEmailSysID);

 

My code:

 

var rec = new GlideRecord('scheduled_import_set');
            rec.get('name', 'Disney Import eDiscovery Custodian LMM');
            rec.run_as = userEmailSysID;
            rec.update();
            gs.info("&&&1.4 ");
            gs.info("&&&2 " + rec.run_as);
          SncTriggerSynchronizer.executeNow(rec);
            gs.sleep(2000);
            gs.info("&&&3 " + userEmailSysID);
5 REPLIES 5

swathisarang98
Giga Sage

Hi @Deepthi13 ,

 

Try replacing SncTriggerSynchronizer.executeNow(rec); with gs.executeNow(rec);

 

Please check and Mark Helpful and Correct if it really helps you.

Regards,

Swathi Sarang

 

tried this gs.executeNow(rec); 
but still this is not working

Hi @Deepthi13 call a script include and create it in global and use gs.executeNow() in that and make sure that script include accessible from is all application scope

 

swathisarang98_0-1709745291166.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

Hi Swathi,

can u please elaborate more in script. what to place in script include.
and how to call in inbound action how to edit it.

 

please find my inbound action current script helps you to edit,(which helps me)

 //now trigger import set synchronously so that data processed
       
 gs.info("&&&1.3 " + userEmailSysID);
            //var rec = new GlideRecord("sysauto_report");
            //gs.sleep(1000);
            var rec = new GlideRecord('scheduled_import_set');
            rec.get('name', 'Disney Import eDiscovery Custodian LMM');
            rec.run_as = userEmailSysID;
            //rec.update();
            gs.info("&&&1.4 ");
            gs.info("&&&2 " + rec.run_as);
           gs.executeNow(rec.get('sys_id'));//SncTriggerSynchronizer.executeNow(rec);
           // gs.sleep(2000);
            gs.info("&&&3 " + userEmailSysID);
            //rec.run_as = '';
            //rec.update();