You need to sign in to do that
Don't have an account?
sam
Can I get Test method for it
public static void contractExpiration(Set<Id> contIds){
List<Contract> contractsToBeUpdated = new List<Contract>();
for(Contract cont : [select Id,EndDate, Status from Contract where Id =: contIds]){
if(cont.Status!='Expired' && cont.Status!='Cancelled'){
cont.EndDate = system.today();
cont.Status = 'Expired';
contractsToBeUpdated.add(cont);
}
}
if(!contractsToBeUpdated.isEmpty()){
UtilClass.isFirstTime = false;
update contractsToBeUpdated;
}
}
List<Contract> contractsToBeUpdated = new List<Contract>();
for(Contract cont : [select Id,EndDate, Status from Contract where Id =: contIds]){
if(cont.Status!='Expired' && cont.Status!='Cancelled'){
cont.EndDate = system.today();
cont.Status = 'Expired';
contractsToBeUpdated.add(cont);
}
}
if(!contractsToBeUpdated.isEmpty()){
UtilClass.isFirstTime = false;
update contractsToBeUpdated;
}
}
Try Below Code 100% Coverage Please Mark It As Best Answer If It Helps
Thank You!