• Sivatej Earla
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I have written this class for the Trailhead challenge. I am able to find that the account gets inserted but,still I am unable to complete the challenge.Its showing the error "Executing the 'insertNewAccount' method failed. Either the method does not exist, is not static, or does not insert the proper account." Can anyone please help?

public with sharing class AccountHandler {
    public static ID insertNewAccount(String str){
        try{
            Account acc=new Account(Name='CENA');
            insert acc;      
            return(acc.Id);
            
        }
        catch(DMLException ex){
            system.debug('Error Message thrown::'+ex.getMessage());
            return(null);
            
        }
    }
}