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
Srinivas CSrinivas C 

Hi please correct me this code, iam facing coList|"List of size 236 too large to display"|0xfb900f3

Please correct me,

public class SendReminderMail{ 
    public void approveRecord(){
        list<Change_Order__c> coList=[select id,Name,Submitted_Date__c 
                                                           from Change_Order__c limit1];
        List<ProcessInstance> PI = [Select Id,TargetObjectId FROM ProcessInstance WHERE TargetObjectId=:coList AND Status='Pending'];  
 if(PI.size() > 0)  
 {  
  List<ProcessInstanceWorkitem> PIWI = [Select Id ,ActorId,Actor.Name,Actor.Email FROM ProcessInstanceWorkitem WHERE ProcessInstanceId=:PI[0].Id];  
  if(PIWI.size() > 0)  
  {  
   Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();  
   req2.setComments('Approving request.');  
   req2.setAction('Approve');  
   req2.setNextApproverIds(new Id[] {UserInfo.getUserId()});  
   req2.setWorkitemId(PIWI[0].Id);  
   Approval.ProcessResult result2 = Approval.process(req2);  
  }  
 }
    }
SwethaSwetha (Salesforce Developers) 
HI Srinivas,
Are you sure this is the only message you are seeing? Do the debug logs show any other error which is likely the underlying cause?

See related: https://salesforce.stackexchange.com/questions/288667/invocable-class-error-list-of-size-127-too-large-to-display 

Thanks