global class UpdateStatuAchievementsDailyBatch implements Database.Batchable { String query; global UpdateStatuAchievementsDailyBatch() { } global Database.QueryLocator start(Database.BatchableContext BC) { return Database.getQueryLocator([select Id,Name,Status_1__c,Status_1_text__c from Statu_Achievements__c where IsEqStatus_Text__c =false]); } global void execute(Database.BatchableContext BC, List saList) { List updateList = new List(); for(sObject obj :saList){ Statu_Achievements__c sa = (Statu_Achievements__c) obj; if(sa.Status_1__c != sa.Status_1_text__c){ sa.Status_1_text__c = sa.Status_1__c; updateList.add(sa); } } if(updateList.size() >0){ update updateList; } } global void finish(Database.BatchableContext BC) { } }