Skip to main content

apex-jobs

Salesforce


Restart salesforce Apex Jobs

Steps to restart SF -> Chaine Integration

  1. Go to Production Developer Console
salesforce menu
  1. From the menu bar, click on Debug -> Open Execute Anonymous Window (CTRL + E)
salesforce developer console debug menu
  1. 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.
salesforce developer console open execute anonymous window
  1. 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;
salesforce execute command
  1. And click on Execute button.

  2. Go to Scheduled Jobs and check the Chaine Scheduled Jobs. (edited)

salesforce apex jobs