• sai dharnesh YARAM
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I saw many questions already posted about this , i compared mine to the soulved cases. finding no differences. 
please help. please find below snapshots of what i have done.
The requirement is 


Before You Start
Verify that the Account object's Type field has the following picklist values: Prospect, Customer, Pending.

Challenge Requirements:
Use the Jump Start Wizard to create a new approval process for the Account object
The approval process name must be Approve New Account
Pick any email template for approval assignment email template
For Entry Criteria, use the following criteria.
Account: Type equals Prospect
Account: Employees greater than 500
For Approver, choose Automatically assign to approver(s) and assign yourself as the approver
Click View Approval Process Detail Page and finish off the remaining requirements.
In the Initial Submission section, add a Field Update action that updates the Account: Type field to Pending. The name of the action must be Account Type To Pending.
In the Final Approval Actions, add a Field Update action that updates the Account: Type field to Customer. The name of the action must be Account Type To Customer.
In the Final Approval Actions section, edit the Record Lock action to unlock the record
In the Final Rejection Actions section, add a Field Update action that updates the Account: Type field to Prospect. The name of the action must be Account Type To Prospect
Activate the approval process



approval processField updates
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);
            
        }
    }
}