
답변 1개
Hi siliveru venkatesh,
You need to update UpdatePosition insteed of pos. Please try this for your code copy. Hope it will help you.
Mark as a best if it helps you.public class DMLUpdate{
public static void RecordstoUpdate(){
List<Position__c> pos = new List<Position__c>();
pos = [Select id, Name, Min_pay__c, Close_Date__c, Max_pay__c from Position__c where Max_pay__c > 500000 ALL ROWS];
if(!pos.isEmpty()){
List<Position__c> UpdatePosition = new List<Position__c>();
for(Position__c po : pos){
UpdatePosition.add(new Position__c(Id = po.id, Close_Date__c = System.today()));
}
if(!UpdatePosition.isEmpty()){
update UpdatePosition;
}
}
}
}
Regards,
Suraj