• jeregar
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    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

 

 

"REQUIRED_FIELD_MISSING: Oportunidad"  (spanish for OpportunityId, I guess)
 
This is the error message, even though I am setting this value, among others.
 
Does anyone know how to identify the field that is missing?
 
First I create the opportunity, setting all required values and more, then I use the returned id and put it in the OpportunityLineItem, but with no luck at all.
 
Thanks to anyone who can help me with this.
 
Jere
 
Has anyone needed to convert a string variable to integer? I need to code a verification digit function, and I am getting the digits from a string with the substring function. Next to that, I need to convert each 'text' number to integer for multiplication.
 
Here is a sample of what I need...
 
Code:
public static boolean CUITVerification(String cuit)
{
       if(cuit.length() != 11)
          return false;
       
       String xx1 = cuit.substring(1,1);
       Integer x1 = xx1;
       x1 = x1 * 5;

       if(x1 == 10)
          return true;

}

 to anyone who can help me...thanks
"REQUIRED_FIELD_MISSING: Oportunidad"  (spanish for OpportunityId, I guess)
 
This is the error message, even though I am setting this value, among others.
 
Does anyone know how to identify the field that is missing?
 
First I create the opportunity, setting all required values and more, then I use the returned id and put it in the OpportunityLineItem, but with no luck at all.
 
Thanks to anyone who can help me with this.
 
Jere
 
Has anyone needed to convert a string variable to integer? I need to code a verification digit function, and I am getting the digits from a string with the substring function. Next to that, I need to convert each 'text' number to integer for multiplication.
 
Here is a sample of what I need...
 
Code:
public static boolean CUITVerification(String cuit)
{
       if(cuit.length() != 11)
          return false;
       
       String xx1 = cuit.substring(1,1);
       Integer x1 = xx1;
       x1 = x1 * 5;

       if(x1 == 10)
          return true;

}

 to anyone who can help me...thanks