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
Dan BroussardDan Broussard 

Stumped on chatter approval quiz

Receiving following error on chatter approvals for Cas object
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]
I do not have a clue as to missing information. This was a very confusing exercise for me. Newbie I am
Best Answer chosen by Dan Broussard
Amit Chaudhary 8Amit Chaudhary 8

You need to select approver in approval steps as shown in below screenshots

User-added image

User-added image

Please mark this as solution if this will help you
Thanks
Amit Chaudhary
amit.salesforce21@gmail.com

All Answers

Amit Chaudhary 8Amit Chaudhary 8
This issue

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);

    }

Below blog wil help you:-
http://www.jitendrazaa.com/blog/salesforce/dynamic-approval-process-based-on-the-apex-and-trigger/
http://salesforce.stackexchange.com/questions/17596/required-field-missing-error-when-approval-process-set-to-manually-select

Please mark this as solution if this will help you
Amit Chaudhary 8Amit Chaudhary 8

You need to select approver in approval steps as shown in below screenshots

User-added image

User-added image

Please mark this as solution if this will help you
Thanks
Amit Chaudhary
amit.salesforce21@gmail.com
This was selected as the best answer
Dan BroussardDan Broussard
Thank you very much. I did not "catch" the relationship between steps and the process. Also thank you for the detailed code. I am a very old assembler programmer from mainframes and just beginning to learn object programming. That was interesting code to analyze.
Layi TaiwoLayi Taiwo
Thank you!