function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PAWAN THOSARPAWAN THOSAR 

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'

Best Answer chosen by PAWAN THOSAR
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Can you try the below apex class
 
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.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Can you try the below apex class
 
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.

Thanks,
This was selected as the best answer
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Pawan,

Do you have any issues in the above code?

Thanks,