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
jeregarjeregar 

AsyncApexJob query by non administrators, privileges problem

How can I configure a non administrator profile to access the AsyncApexJob list by the apex class.  Here is the method that I need to run. 

 

 

public PageReference loadJobsStatus() {
   this.jobs.clear();
   try{
      for(AsyncApexJob j : [select Id, Status, NumberOfErrors, JobItemsProcessed, TotalJobItems, CreatedBy.Name, CompletedDate, CreatedDate
    	from AsyncApexJob where JobType = 'BatchApex' AND CreatedDate >= YESTERDAY order by createdDate desc]) {
           this.jobs.add(j);
        }
   }catch(Exception e){
      return null;
   }
   return null;
}

 This loadJobsStatus method gives me 'Insufficient Privileges' when logged in by a different user than the administrator.

 

Thanks in advance

 

Jeremias

 

 

Best Answer chosen by Admin (Salesforce Developers) 
WizradWizrad

A: View Setup & Configuration

All Answers

WizradWizrad

Did you ever figure this one out?

 

I've hit the same problem and i'm not sure what profile checkbox needs to be checked.

 

Thanks,

WizradWizrad

A: View Setup & Configuration

This was selected as the best answer
Rajesh YeddulaRajesh Yeddula
How to resolve this issue , could you please suggest us