SncTriggerSynchronizer.executeNow(schImport)

abhay1069095
Giga Contributor

Hi ,

i want to know what does "SncTriggerSynchronizer.executeNow(schImport)" returns.

it returns a sysid but i have checked everywhere but i dont know from which table it belongs.

can i pass a variable to scheduled import while calling it via script ?

Regards,

Abhay

8 REPLIES 8

Do you want to print the name of the scheduled job?


abhay1069095
Giga Contributor

i know the sys_id and name thats why i was able to initiate the import by passing the object.


var schImport=new GlideRecord('scheduled_import_set');


schImport.addQuery('sys_id',"mysysid");


schImport.query();


if(schImport.next()){


var i = SncTriggerSynchronizer.executeNow(schImport);


gs.print(i);


}


i got the sysid in 'i', it belongs to which record ?


can i have a detailed code written in the executeNow   function ?


Hi Abhay,



I think when you execute a scheduled job a record is added to the sys_trigger table. Can you go and check there ?



Regards,


Rahul


VaranAwesomenow
Mega Sage

You can use this article to find out table based on sys_id.

https://www.servicenow.com/community/now-platform-articles/script-get-table-based-on-sysid/ta-p/2319...

Having said that, it returns sys_id of table = v_db_trigger (

But I couldnt figure out how to use that and handle that for next steps, so best bet would be to look at import sets and pickup most recent import set for that scheduled import.