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
Darren RogersDarren Rogers 

Routing Records with Approvals Trailhead

Hello, 
When I try and complete the challnge i recieve the below error, 
Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: [nextApproverIds]: [nextApproverIds]
Really not sure what this means ... Can anyone help please?
Best Answer chosen by Darren Rogers
KaranrajKaranraj
Darren  - One of the challenge requirements is : "Normally the approver would be someone else. In this instance, assign yourself to be the approver.".If you assign yourself as the approver (vs 'Manager of Record Owner'), you should be able to pass the challenge.

Check this thread which helps you to solve your problem https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BBAyIAO

All Answers

KaranrajKaranraj
Darren  - One of the challenge requirements is : "Normally the approver would be someone else. In this instance, assign yourself to be the approver.".If you assign yourself as the approver (vs 'Manager of Record Owner'), you should be able to pass the challenge.

Check this thread which helps you to solve your problem https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BBAyIAO
This was selected as the best answer
Darren RogersDarren Rogers
Thank you Karanraj, Silly mistake on my part but thanks for the speedy responce. 
Amit Chaudhary 8Amit Chaudhary 8
You need to select approver in approval steps as shown in below screenshots
User-added image
User-added image


For Standard Approval:-
When you are on the detail page of the approval process - in the section "Approval Steps" - click on "Edit" in front of the step - Next -  Next - you will come up with the screen "Step 3. Select Assigned Approver" - select "Automatically assign to approver(s)." - and pick "related User - Created By".

FOR APEX CODE:- 

If you are using code for approval then please try below code :-

 
public void submitForApproval(Opportunity opp)
    {
        // Create an approval request for the Opportunity
        Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting request for approval automatically using Trigger');
        req1.setObjectId(opp.id);
        req1.setNextApproverIds(new Id[] {opp.Next_Approver__c});

        // Submit the approval request for the Opportunity
        Approval.ProcessResult result = Approval.process(req1);

    }

Same issue resolved on below link
https://developer.salesforce.com/forums?id=906F0000000BK7rIAG


Please mark this as solution if this will help you
Thanks
Amit Chaudhary
amit.salesforce21@gmail.com
 
Jory DeanJory Dean
I am currently getting an error "Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Approval_Process__c]: [Approval_Process__c]" 

Any advice on how to solve this?