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
APatAPat 

Error while creating a approval request via Apex

Hi All,

 

I'm trying to create an approval request via Apex code... Stuck with below mentioned error:

 

System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: []

Error is in expression '{!submitAndProcessApprovalRequest}' in component <apex:page> in page testapproval

     

 

   Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
        req1.setComments('Submitting Multiple request for approval.');
        req1.setObjectId('00Q9000000A4LXg');
        List<string> idList = new List<string>();
        idList.add('00590000000j0fM');
        idList.add('00590000000j0yU');

        req1.setNextApproverIds(idList);
        Approval.ProcessResult result = Approval.process(req1);

 

Need Help..

 

Thanks