• Dhruv Nirgude
  • NEWBIE
  • 40 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 9
    Replies
Here are my script and VF Page

<apex:page StandardController="Account" recordSetVar="item">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockTable value="{!item}" var="a">
                <apex:column>
                    <apex:facet name="header"><apex:inputcheckbox/></apex:facet>   
                    <apex:inputcheckbox/>   
                </apex:column>
                
                <apex:column value="{!a.Name}"/>
                <apex:column value="{!a.industry}"/>
                <apex:Column value="{!a.phone}"/>
                <apex:column value="{!a.Rating}"/> 
                
                <apex:column headerValue="Action">
                    <apex:commandbutton value="add"/>
                    <apex:commandbutton value="del"/>
                </apex:column>
                
                <apex:column>
                    <apex:commandlink value="edit"/>&nbsp;|&nbsp;
                    <apex:commandlink value="new"/>
                </apex:column>
            </apex:pageBlockTable> 
        </apex:pageBlock>
    </apex:form>
</apex:page>
after scripting getting this paper
Here is my Batch Class. Below the class i mentioned errors as well.

global Class BatchApexContact Implements Database.Batchable<sobject>, Database.Stateful{
    //Global Class BatchApexContact Implements Database.Batchable<sobject> {
    
    Integer RecordProcessed = 0;
    Integer RecordFailed = 0;
    List<Contact> lstCon = new List<Contact>();
    Integer NoOfTran = 0;
    
    //start method
    public Database.QueryLocator start(Database.BatchableContext bc){
        return Database.getQueryLocator([Select id, FirstName, LastName from Contacts where FirstName like ' mm1']);
    }      
    public void execute (Database.BatchableContext bc, List<Contact> con){
        List<Contact> lstConFinal = new List<Contact>();
        for(Contact C: con){
            //Scenario Unsucessful Transaction
            if(c.firstName ==mm1 && c.Lastname == 'nnn1'){
                RecordProcessed = RecordProcessed+1;
                c.firstname = A1;
                c.LastName = B2;  
                lstConFinal.add(C);
                lstCon.add(C);
            }  else {
                RecordFailed =  RecordFailed+1;
            }
        }    
        Update lstConFinal;
        NoOfTran = con.size();
        
        //end of Execute 
        
        // Finish Method
        Public void finish (Database.BatchableContext bc){
            AsyncApexJob job = [Select Id ,CreatedDate, CreatedByIdDate, JobType, ApexClassId, Status, JobItemsProcessed,
                                TotalJobItems, NumberOfErrors, CompletedDate, MethodName,
                                ExtendedStatus From AsyncApexJob where Id=: bc.getJobId()];
            System.debug('*** JobId: '+bc.getJobId());
            System.debug('*** job:' +job);
            System.debug('*** Total no of Transactions: '+NoOfTran);   
            System.debug('*** Record Processed: ' +RecordProcessed);
            System.debug('*** No of Records Failed : '+RecordFailed);
            System.debug('*** List Of records Processed:' +lstCon);
            System.debug('***How Many recs were Processed:' +lstCon.size());
        }
    }    
}

1 Class BatchApexContact must implement the method: void Database.Batchable<SObject>.finish(Database.BatchableContext)

2Unexpected token 'Public'.
3Missing ';' at 'finish'
4Extra ')', at 'bc'.

        

 
Here are my VF codes and Apex Class 

<apex:page controller="Calc" >
<apex:form>
     <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <apex:pageBlock title="Contact Edit" Tabstyle="Contact" id="tryReneder">
        <apex:pageBlockButtons>
       <apex:commanButton action="{!add}" value="Add" Reneder="tryReneder"/>
         <apex:commandButton action="{!redirect}" value="navigate"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="2">
            <apex:pageBlockSectionItem>
                <apex:outputLabel value="Input1"/>
                <apex:inputText value="{!input"}/>
            </apex:pageBlockSectionItem>
               <apex:pageBlockSectionItem>
                   <apex:outputLabel value="Input2"/>
                   <apex:inputText value="{!input}"/>
                </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem>
              <apex:outputLabel value="output"/>
              <apex:inputText value="{!output}"/>
                </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>    
</apex:page>

public class Calc {
    public Integer input1;
    public Integer input2;
    public Integer output;
    // Constructor
    public Calc(){
        this.input1=0;
        this.input2=0;
        this.output=0; //
    }
//Getter and Setter method
//Getter method to get value from Apex to VF page
//Setter method is to set values from VF to Apex class
    public Integer getInput(){
        return input1;      
}
    public void setInput1(Integer input1){
        this.input1=input1;       
    }
    public Integer getoutput(){
        return output;
    }
    public void setoutput(Integer output){
        this.output=output;
    }
    public Integer getinput2(){
        return input2;
    }
    public void setinput2(Integer input2){
        this.input2=input2;
    }
        //add Method
        //addtwoinputs
    public void add(){
        this.output=this.input1+this.input2;
    }
    // Redirect method to demo pagereference
    public PageReference redirect(){
        system.debug('lol');
        pagereference p = new PageReference('/apex/CustomCalcContact');
        return p;     
    }
     }
Attribute value in <apex:inputField> must contain only a formula expression that resolves to a single controller variable or method in Test at line 43 column 54

<apex:page standardController="contact">
 <apex:form>
    <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <p> Contacts not associated with accounts are private and cannot be viewed by other  users or included in reports.</p>
    <apex:pageblock title="Contact Edit" Tabstyle="Contact">
   <apex:pageblocksection title="Contact Information"     columns="1" Collapsible="True">
    
       <apex:inputField value="{Contact.FirstName}"/>
        <apex:inputField value="{Contact.LastName}"/>
        <apex:inputField value="{Contact.Email}"/>
        <apex:inputField value="{Contact.Birthdate}"/>
        <apex:inputField value="{Contact.Level__c}"/>

    </apex:pageblocksection>
        <apex:pageBlockButtons>
            <apex:commandButton action="{!save}" value="save"/>
            <apex.commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons> 
                                               
    </apex:pageblock>
    </apex:form>
</apex:page>
 
I am trying to built a VF page. I wrote tags for labels and their input box but i was able to create only Labels not along with their Input Box. here is my VF Tags

<apex:page standardController="contact">
 <apex:form>
    <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <p> Contacts not associated with accounts are private and cannot be viewed by other  users or included in reports.</p>
    <apex:pageblock title="Contact Edit" Tabstyle="Contact">
   <apex:pageblocksection title="Contact Information"     columns="1" Collapsible="True">
    
       <apex:pageBlockSectionItem>
        <apex:outputLabel value="First Name"/>
        <apex.inputText value="{!Contact.FirstName}"/>
      </apex:pageBlockSectionItem>
       
       <apex:pageBlockSectionItem>
       <apex:outputlabel value="Last Name"/>
       <apex.inputText value="{!Contact.LastName}"/>
    </apex:pageBlockSectionItem>
       
        <apex:pageBlockSectionItem>
            <apex:outputlabel value="BirthDate"/>
            <apex.inputText value="{Contact.birthdate}"/>
    </apex:pageBlockSectionItem>
    </apex:pageblocksection>
                                                                       
    </apex:pageblock>
    </apex:form>
</apex:page>      
public class CalculateCaseOrigin {
@future
    public static void countCasesBasedOnOrigin(List<Id> accIds){
  List<Account> accList = [Select Id, Cases_Through_Email__c, Cases_Through_Phone__c, Cases_Through_Web__c'
                          , (Select Id, Origin From Cases)
                          From Account where Id IN: accIds];       
     
        for (Account acc = accList){
       Integer Email=0, Web=0, Phone=0;     
       
            for (Case ca : acc.Cases){
                if(ca.Origin == 'Phone'){
                phone++;
                }else if(ca.Origin =='Web'){
                 Web++;
                }else if(ca.Origin == 'Email'){
                 Email++;   
                }    
                }       
              acc.Cases_Through_Email__c = Email;
              acc.Cases_Through_Phone__c = Phone;
              acc.Cases_Through_web__c = Web;
                  }     
       if(!accList.isEmpty)     
        update accList;
           }     
        }   
    
errors - 
*Missing closing quote character ' on string.

*Unexpected token '\n                          , (Select Id, Origin From Cases)\n                          From Account where Id IN: accIds];       \n     \n        for (Account acc = accList){\n       Integer Email=0, Web=0, Phone=0;     \n       \n            for (Case ca : acc.Cases){\n                if(ca.Origin == '.

*Expecting 'FROM' but was: '\n                          , (Select Id, Origin From Cases)\n                          From Account where Id IN: accIds];       \n     \n        for (Account acc = accList){\n       Integer Email=0, Web=0, Phone=0;     \n       \n            for (Case ca : acc.Cases){\n                if(ca.Origin == '

*Missing ';' at '){\n                phone++;\n                }else if(ca.Origin =='

*Illegal string literal: Line breaks are not allowed in string literals

*Missing ';' at '){\n                 Web++;\n                }else if(ca.Origin == '


*Illegal string literal: Line breaks are not allowed in string literals

*Expecting ';' but was: '<EOF>'

*Method must have a body
ailedFirst error: Update failed. First exception on row 1 with id 0015g00000N8j5YAAR; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, For this particular combination we can not create more than one child record: []

My code
public class AccountCalculator {
@future
    public static void countContacts(List<Id> accIds){
        List<Account> accList  = [SELECT Id from Account where Id IN:accIds];

        for(Account acc : accList){
        acc.Number_Of_Contacts__c = acc.Contacts.size();    
        }        
        if(!accList.isEmpty()){
        }
    update accList;
    }
}


 
Can’t Save Record

We can't save this record because the “Quick Action In Account” process failed. Give your Salesforce admin these details. OpportunityTrigger: execution of AfterInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.AccountId Class.OppoTriggerHandler.calculateAnnualRevenue: line 53, column 1 Class.OppoTriggerHandler.onAfterInsert: line 11, column 1 Trigger.OpportunityTrigger: line 4, column 1 Error ID: 851754416-130695 (1954185174) 11, column 1 Trigger.OpportunityTrigger: line 4, column 1 Error ID: 851754416-130695 (1954185174).
 
Hey, In Trigger and TriggerHandlerClass I've some errors regarding "Method Doesn't exist" as well as "Variable Doesn't exist". In Below i am going to show my code as well as all those error points which i found in my Problem tab.
Trigger -
trigger OpportunityTrigger on Opportunity (after insert, after update, after delete){
    if (trigger.isAfter){
        if(Trigger.isInsert){
         OppoTriggerHandler.onAfterInsert(Trigger.New);
        }else if(Trigger.isUpdate){
         OppoTriggerHandler.onAfterUpdate(Trigger.New, Trigger.oldMap);
        }else if(Trigger.isDelete){
         OppoTriggerHandler.onAfterDelete(Trigger.Old);
        }    
    }
}

TriggerHandlerClass-
public class OppoTriggerHandler {
    public static void onAfterInsert(List<opportunity> newList){ 
    Set<Id> accIds = new  Set<Id>();
    List<Account> accToBeUpdated= new List<Account>();
     
       for(Opportunity opp : newList){
           if(opp.AccountId != null){
           accIds.add(opp.AccountId);    
        }      
    }    
 accToBeUpdated = calculateAnnualRevenue(accIds);
        if(!accToBeUpdated.isEmpty()){
       update accToBeUpdated;
        }    
    }
    public static void onAfterUpdate(List<Opportunity> newList, Map<Id,Opportunity> oldMap){
    Set<Id> accIds = new Set<Id>();
    List<Account> accToBeUpdated = new List<Account>();
        
        for(Opportunity opp : newList){
            if(opp.AccountId != null && opp.Amount != oldMap.get(opp.Id).Amount){
             accIds.add(opp.AccountId);     
            }   
        }
  accToBeUpdated = calculateAnnualRevenue(accIds);
 
        if(!accToBeUpdated.isEmpty()){ 
         update accToBeUpdated;
        }
    }
    public static void OnAfterDelete (List<Opportunity> oldList){
    Set<Id> accIds = new Set<Id>();
   List<Account> accToBeUpdated = new List<Account>();
        
        for(Opportunity opp : oldList){
            if(opp.AccountId != null){
             accIds.add(opp.AccountId);      
            }     
        }      
  accToBeUpdated = calculateAnnualRevenue(accIds);
   
        if(!accToBeUpdated.isEmpty()){
        update accToBeUpdated;
        }      
    }     
    public static List<Account> calculationAnnualRevenue(Set<Id> accIds){
    List<Account> accToBeUpdated = new List<Account>(); 
   Map<Id, Decimal> accIdToAnnualRevenue = new Map<Id, Decimal>();
   
        for(Opportunity opp : [Select Id, Amount From Opportunity Where AccountId IN : accIds]){
      Decimal total = 0;
            if(accIdToAnnualRevenue.containsKey(opp.AccountId)){
          total = accIdAnnualRevenue.get(opp.AccountId);
            }
            if(opp.Amount != null){
          total = total +opp.Amount;
            }         
     accIdToAnnualRevenue.put(opp.AccountId,total);
        }
        if(!accIdAnnualRevenue.isEmpty()){
            for(Id i : accIdToAnnualRevenue.keySet()){
          Account acc = new Account();
          acc.Id = i;
         acc.AnnualRevenue = accIdToAnnualRevenue.get(i);       
        accToBeUpdated.add(acc);   
            }       
        }   
    return accToBeUpdated;    
    }   
}

Error Points
1 Method does not exist or incorrect signature: void calculateAnnualRevenue(Set<Id>) from the type OppoTriggerHandler.

2 Variable does not exist: accIdAnnualRevenue.

3 Method does not exist or incorrect signature: void onAfterInsert(List<Opportunity>) from the type OppoTriggerHandler.
Hey, In Apex Trigger i have 2 big problems one is method does not exist and last one variable does not exist these shown in Problem tab and that type of issue i saw in every TriggerHandlerClass. So below i mentioned my code.

public class Account2TriggerHandler {
    public static void createRelatedOpp(List<Account> newList){
    List<Opportunity> oppoToBeInserted = new List<Opportunity>();
        for(Account acc : newList){
    Opportunity opp = new Opportunity();
   opp.Name = acc.Name;
   opp.AccountId = Acc.Id;
   opp.StageName = 'Prospecting';
   opp.CloseDate = System.today();
   oppToBeInserted.add(opp);
 }    
      if(!oppToBeInserted.isEmpty()){
       insert oppToBeInserted;
  }
  }
Here are my script and VF Page

<apex:page StandardController="Account" recordSetVar="item">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockTable value="{!item}" var="a">
                <apex:column>
                    <apex:facet name="header"><apex:inputcheckbox/></apex:facet>   
                    <apex:inputcheckbox/>   
                </apex:column>
                
                <apex:column value="{!a.Name}"/>
                <apex:column value="{!a.industry}"/>
                <apex:Column value="{!a.phone}"/>
                <apex:column value="{!a.Rating}"/> 
                
                <apex:column headerValue="Action">
                    <apex:commandbutton value="add"/>
                    <apex:commandbutton value="del"/>
                </apex:column>
                
                <apex:column>
                    <apex:commandlink value="edit"/>&nbsp;|&nbsp;
                    <apex:commandlink value="new"/>
                </apex:column>
            </apex:pageBlockTable> 
        </apex:pageBlock>
    </apex:form>
</apex:page>
after scripting getting this paper
Here are my VF codes and Apex Class 

<apex:page controller="Calc" >
<apex:form>
     <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <apex:pageBlock title="Contact Edit" Tabstyle="Contact" id="tryReneder">
        <apex:pageBlockButtons>
       <apex:commanButton action="{!add}" value="Add" Reneder="tryReneder"/>
         <apex:commandButton action="{!redirect}" value="navigate"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="2">
            <apex:pageBlockSectionItem>
                <apex:outputLabel value="Input1"/>
                <apex:inputText value="{!input"}/>
            </apex:pageBlockSectionItem>
               <apex:pageBlockSectionItem>
                   <apex:outputLabel value="Input2"/>
                   <apex:inputText value="{!input}"/>
                </apex:pageBlockSectionItem>
          <apex:pageBlockSectionItem>
              <apex:outputLabel value="output"/>
              <apex:inputText value="{!output}"/>
                </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>    
</apex:page>

public class Calc {
    public Integer input1;
    public Integer input2;
    public Integer output;
    // Constructor
    public Calc(){
        this.input1=0;
        this.input2=0;
        this.output=0; //
    }
//Getter and Setter method
//Getter method to get value from Apex to VF page
//Setter method is to set values from VF to Apex class
    public Integer getInput(){
        return input1;      
}
    public void setInput1(Integer input1){
        this.input1=input1;       
    }
    public Integer getoutput(){
        return output;
    }
    public void setoutput(Integer output){
        this.output=output;
    }
    public Integer getinput2(){
        return input2;
    }
    public void setinput2(Integer input2){
        this.input2=input2;
    }
        //add Method
        //addtwoinputs
    public void add(){
        this.output=this.input1+this.input2;
    }
    // Redirect method to demo pagereference
    public PageReference redirect(){
        system.debug('lol');
        pagereference p = new PageReference('/apex/CustomCalcContact');
        return p;     
    }
     }
I am trying to built a VF page. I wrote tags for labels and their input box but i was able to create only Labels not along with their Input Box. here is my VF Tags

<apex:page standardController="contact">
 <apex:form>
    <apex:sectionHeader title="Contact" subtitle="New Contact"/>
    <p> Contacts not associated with accounts are private and cannot be viewed by other  users or included in reports.</p>
    <apex:pageblock title="Contact Edit" Tabstyle="Contact">
   <apex:pageblocksection title="Contact Information"     columns="1" Collapsible="True">
    
       <apex:pageBlockSectionItem>
        <apex:outputLabel value="First Name"/>
        <apex.inputText value="{!Contact.FirstName}"/>
      </apex:pageBlockSectionItem>
       
       <apex:pageBlockSectionItem>
       <apex:outputlabel value="Last Name"/>
       <apex.inputText value="{!Contact.LastName}"/>
    </apex:pageBlockSectionItem>
       
        <apex:pageBlockSectionItem>
            <apex:outputlabel value="BirthDate"/>
            <apex.inputText value="{Contact.birthdate}"/>
    </apex:pageBlockSectionItem>
    </apex:pageblocksection>
                                                                       
    </apex:pageblock>
    </apex:form>
</apex:page>      
public class CalculateCaseOrigin {
@future
    public static void countCasesBasedOnOrigin(List<Id> accIds){
  List<Account> accList = [Select Id, Cases_Through_Email__c, Cases_Through_Phone__c, Cases_Through_Web__c'
                          , (Select Id, Origin From Cases)
                          From Account where Id IN: accIds];       
     
        for (Account acc = accList){
       Integer Email=0, Web=0, Phone=0;     
       
            for (Case ca : acc.Cases){
                if(ca.Origin == 'Phone'){
                phone++;
                }else if(ca.Origin =='Web'){
                 Web++;
                }else if(ca.Origin == 'Email'){
                 Email++;   
                }    
                }       
              acc.Cases_Through_Email__c = Email;
              acc.Cases_Through_Phone__c = Phone;
              acc.Cases_Through_web__c = Web;
                  }     
       if(!accList.isEmpty)     
        update accList;
           }     
        }   
    
errors - 
*Missing closing quote character ' on string.

*Unexpected token '\n                          , (Select Id, Origin From Cases)\n                          From Account where Id IN: accIds];       \n     \n        for (Account acc = accList){\n       Integer Email=0, Web=0, Phone=0;     \n       \n            for (Case ca : acc.Cases){\n                if(ca.Origin == '.

*Expecting 'FROM' but was: '\n                          , (Select Id, Origin From Cases)\n                          From Account where Id IN: accIds];       \n     \n        for (Account acc = accList){\n       Integer Email=0, Web=0, Phone=0;     \n       \n            for (Case ca : acc.Cases){\n                if(ca.Origin == '

*Missing ';' at '){\n                phone++;\n                }else if(ca.Origin =='

*Illegal string literal: Line breaks are not allowed in string literals

*Missing ';' at '){\n                 Web++;\n                }else if(ca.Origin == '


*Illegal string literal: Line breaks are not allowed in string literals

*Expecting ';' but was: '<EOF>'

*Method must have a body
Can’t Save Record

We can't save this record because the “Quick Action In Account” process failed. Give your Salesforce admin these details. OpportunityTrigger: execution of AfterInsert caused by: System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Opportunity.AccountId Class.OppoTriggerHandler.calculateAnnualRevenue: line 53, column 1 Class.OppoTriggerHandler.onAfterInsert: line 11, column 1 Trigger.OpportunityTrigger: line 4, column 1 Error ID: 851754416-130695 (1954185174) 11, column 1 Trigger.OpportunityTrigger: line 4, column 1 Error ID: 851754416-130695 (1954185174).
 
Hey, In Trigger and TriggerHandlerClass I've some errors regarding "Method Doesn't exist" as well as "Variable Doesn't exist". In Below i am going to show my code as well as all those error points which i found in my Problem tab.
Trigger -
trigger OpportunityTrigger on Opportunity (after insert, after update, after delete){
    if (trigger.isAfter){
        if(Trigger.isInsert){
         OppoTriggerHandler.onAfterInsert(Trigger.New);
        }else if(Trigger.isUpdate){
         OppoTriggerHandler.onAfterUpdate(Trigger.New, Trigger.oldMap);
        }else if(Trigger.isDelete){
         OppoTriggerHandler.onAfterDelete(Trigger.Old);
        }    
    }
}

TriggerHandlerClass-
public class OppoTriggerHandler {
    public static void onAfterInsert(List<opportunity> newList){ 
    Set<Id> accIds = new  Set<Id>();
    List<Account> accToBeUpdated= new List<Account>();
     
       for(Opportunity opp : newList){
           if(opp.AccountId != null){
           accIds.add(opp.AccountId);    
        }      
    }    
 accToBeUpdated = calculateAnnualRevenue(accIds);
        if(!accToBeUpdated.isEmpty()){
       update accToBeUpdated;
        }    
    }
    public static void onAfterUpdate(List<Opportunity> newList, Map<Id,Opportunity> oldMap){
    Set<Id> accIds = new Set<Id>();
    List<Account> accToBeUpdated = new List<Account>();
        
        for(Opportunity opp : newList){
            if(opp.AccountId != null && opp.Amount != oldMap.get(opp.Id).Amount){
             accIds.add(opp.AccountId);     
            }   
        }
  accToBeUpdated = calculateAnnualRevenue(accIds);
 
        if(!accToBeUpdated.isEmpty()){ 
         update accToBeUpdated;
        }
    }
    public static void OnAfterDelete (List<Opportunity> oldList){
    Set<Id> accIds = new Set<Id>();
   List<Account> accToBeUpdated = new List<Account>();
        
        for(Opportunity opp : oldList){
            if(opp.AccountId != null){
             accIds.add(opp.AccountId);      
            }     
        }      
  accToBeUpdated = calculateAnnualRevenue(accIds);
   
        if(!accToBeUpdated.isEmpty()){
        update accToBeUpdated;
        }      
    }     
    public static List<Account> calculationAnnualRevenue(Set<Id> accIds){
    List<Account> accToBeUpdated = new List<Account>(); 
   Map<Id, Decimal> accIdToAnnualRevenue = new Map<Id, Decimal>();
   
        for(Opportunity opp : [Select Id, Amount From Opportunity Where AccountId IN : accIds]){
      Decimal total = 0;
            if(accIdToAnnualRevenue.containsKey(opp.AccountId)){
          total = accIdAnnualRevenue.get(opp.AccountId);
            }
            if(opp.Amount != null){
          total = total +opp.Amount;
            }         
     accIdToAnnualRevenue.put(opp.AccountId,total);
        }
        if(!accIdAnnualRevenue.isEmpty()){
            for(Id i : accIdToAnnualRevenue.keySet()){
          Account acc = new Account();
          acc.Id = i;
         acc.AnnualRevenue = accIdToAnnualRevenue.get(i);       
        accToBeUpdated.add(acc);   
            }       
        }   
    return accToBeUpdated;    
    }   
}

Error Points
1 Method does not exist or incorrect signature: void calculateAnnualRevenue(Set<Id>) from the type OppoTriggerHandler.

2 Variable does not exist: accIdAnnualRevenue.

3 Method does not exist or incorrect signature: void onAfterInsert(List<Opportunity>) from the type OppoTriggerHandler.
Hey, In Apex Trigger i have 2 big problems one is method does not exist and last one variable does not exist these shown in Problem tab and that type of issue i saw in every TriggerHandlerClass. So below i mentioned my code.

public class Account2TriggerHandler {
    public static void createRelatedOpp(List<Account> newList){
    List<Opportunity> oppoToBeInserted = new List<Opportunity>();
        for(Account acc : newList){
    Opportunity opp = new Opportunity();
   opp.Name = acc.Name;
   opp.AccountId = Acc.Id;
   opp.StageName = 'Prospecting';
   opp.CloseDate = System.today();
   oppToBeInserted.add(opp);
 }    
      if(!oppToBeInserted.isEmpty()){
       insert oppToBeInserted;
  }
  }