• Rajesh Yeddula
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

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