• Aman Gupta 161
  • NEWBIE
  • 5 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi Team ,
Could you please help me below apex batch job need to run every minute
but no lock it's executng every 1hour please find below screenshot
User-added image
global class ServiceClaimBatchimplements Database.Batchable<SObject>, Database.AllowsCallouts, Database.Stateful{

    private  void rescheduleBurstSMSResponse(){
        try{
        Datetime dt = system.now().addMinutes(1);          
        String day = string.valueOf(system.now().day());
        String month = string.valueOf(system.now().month());
        String hour = string.valueOf(system.now().hour());
        String minute = string.valueOf(system.now().minute());
        String second = string.valueOf(system.now().second());
        String year = string.valueOf(system.now().year());
        
        String cronExpression = '' + dt.second() + ' ' + dt.minute() + ' ' + dt.hour() + ' ' + dt.day() + ' ' + dt.month() + ' ? ' + dt.year();
        String strSchedule = '0 ' + minute + ' ' + hour + ' ' + day + ' ' + month + ' ?' + ' ' + year;
 
            
            if(Test.isRunningTest()) {
            //This will throw Divide by 0 error and code will move to catch block
            Integer divideError = 123/0;
        }
                System.schedule(cronExpression, strSchedule, new ScheduleServiceClaim());
        }catch(Exception ex){
            System.debug(ex);
            System.debug(ex.getMessage());
            System.debug(ex.getLineNumber());
        }
    }


 ...........................................................
global class ScheduleServiceClaim implements Schedulable {
    global void execute(SchedulableContext sc){
        Database.executeBatch(new ServiceClaimBatch());
    }
}

Will appricate as best answer please help me it is killing my head 
  • November 03, 2020
  • Like
  • 0
I have built the reports and dashboards as outlined in the requirements, but I'm getting the following error "Challenge Not yet complete... here's what's wrong: Couldn't find a component with the title 'My Top Accounts'."  
User-added image

However, I have the component on the dashboard as you can see below.
User-added image
What am I missing?