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

@Deepthi13  ,

 

   gs.executeNow()  will Work in Scoped Apps but not Sure what's the Issue , So I would recommend the Similar Process which Swathi have Mentioned 

Script Include : 

shyamkumarVK_0-1709748369915.png

var Test = Class.create();
Test.prototype = {
    initialize: function() {
    },
schedule : function (){

            var rec = new GlideRecord('scheduled_import_set');
            rec.get('name', 'Disney Import eDiscovery Custodian LMM');
            rec.run_as = userEmailSysID;
            gs.info("&&&1.4 ");
            gs.info("&&&2 " + rec.run_as);
           gs.executeNow(rec);
            gs.info("&&&3 " + userEmailSysID);
},
    type: 'Test'
};

 

In your Inbound Call Script Include with this Syntax 

 

global.scriptincludeName().functionName();

 

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar