Write an Apex Program, to Update the Banking Industry Customer Records as below Account:Rating = 'Hot' Account:AnnualRevenue = 6000000 Account:Type = 'Customer - Direct' Account:CustomerPriority__C = 'High'
public class UpdateBankingIndustryrecords {
public void updaterecordbanking(){
List<Account> acctoupdate= new List<Account>();
List<Account> acclist=[select id,Rating,AnnualRevenue,Type,Industry,CustomerPriority__C from Account where industry='Banking' ];
For (Account acc: acclist){
acc.rating='Hot';
acc.AnnualRevenue=6000000;
acc.type='Customer - Direct';
acc.CustomerPriority__C='High';
acctoupdate.add(acc);
}
update acctoupdate;
}
}
You can execute the apex class from anonomus window as below.
UpdateBankingIndustryrecords ub= new UpdateBankingIndustryrecords();
ub.updaterecordbanking();
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
public class UpdateBankingIndustryrecords {
public void updaterecordbanking(){
List<Account> acctoupdate= new List<Account>();
List<Account> acclist=[select id,Rating,AnnualRevenue,Type,Industry,CustomerPriority__C from Account where industry='Banking' ];
For (Account acc: acclist){
acc.rating='Hot';
acc.AnnualRevenue=6000000;
acc.type='Customer - Direct';
acc.CustomerPriority__C='High';
acctoupdate.add(acc);
}
update acctoupdate;
}
}
You can execute the apex class from anonomus window as below.
UpdateBankingIndustryrecords ub= new UpdateBankingIndustryrecords();
ub.updaterecordbanking();
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Can you try the below apex class
You can execute the apex class from anonomus window as below.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Can you try the below apex class
You can execute the apex class from anonomus window as below.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Do you have any issues in the above code?
Thanks,