apex-jobs
Salesforce
Restart salesforce Apex Jobs
Steps to restart SF -> Chaine Integration
- Go to Production Developer Console

- From the menu bar, click on Debug -> Open Execute Anonymous Window (CTRL + E)

- If that window already has some code, then take backup because some other developer may need that code in future. And erase the code from the window.

- Copy and paste following code snippet in the same window.
LoadTab__c config = LoadTab__c.getOrgDefaults();
//check if the scheduler is allowed to execute
if(config != null && config.Activate_Data_Dispatcher_Service__c) {
//schedule the next batch
LoadDataDispatcher.scheduleNextBatch(config);
}
For FreightFriend:
FreightFriend__c config = FreightFriend__c.getOrgDefaults();
//check if the scheduler is allowed to execute
if(config != null && config.Activate_Data_Dispatcher_Service__c) {
//schedule the next batch
LoadFreightFriendDispatcher.scheduleNextBatch(config);
}
For NewTrul, seems like this is what is used:
Database.executeBatch(new Newtrul_LoadSyncBatch(), 1);
Newtrul_scheduler p = new Newtrul_scheduler (); //Schedule apex class name
Datetime sysTime = System.now().addMinutes(1);
String cronExpression = '' + sysTime.second() + ' ' + sysTime.minute() + ' ' +
sysTime.hour() + ' ' + sysTime.day() + ' ' + sysTime.month() + ' ? ' +
sysTime.year();
system.schedule('Newtrul Job22', cronExpression, p);
Database.executeBatch(new Newtrul_LoadSyncBatch(), 1);
list<Newtrul_Error_Log__c> obj = new list<Newtrul_Error_Log__c>();
obj = [Select ID,name from Newtrul_Error_Log__c limit 9999];
Delete Obj;

And click on Execute button.
Go to Scheduled Jobs and check the Chaine Scheduled Jobs. (edited)
