• Chris Benoit
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
When trying to Compile All Classes, I am getting an Insufficient Privileges error.  This jsut started happening yesterday. 

Where can I start looking to figure out why this is happening?
This is my first attempt at apex.  Can anone help me understand why this loop only updates one record when it should be updating multiple?

global class Idea_Votes_Copy_to_Enhancement implements Schedulable{
    global void execute(SchedulableContext ctx) {
        List<SFDC_Component__c> enhList = new List <SFDC_Component__c>();
        SFDC_Component__c ER = new SFDC_Component__c();
        List<Idea> iList=[SELECT VoteTotal, Enhancement_Requirement_ID__c FROM Idea WHERE VoteTotal >0 AND Status !='Deployed' AND Enhancement_Requirement_ID__c != null];
           for(idea i:IList){
            ER.id = i.Enhancement_Requirement_ID__c;
            ER.Vote_Count__c = i.VoteTotal;
            enhList.add(ER);
             }
        Set<SFDC_Component__c> erSet = new Set<SFDC_Component__c>();
        erSet.addAll(enhList);
        enhList.clear();
        enhList.addAll(erSet);  
        upsert enhList; 
    }
}
I am trying to create trigger on the Vote object, but Vote does not show up in the picklist when I try to create the trigger.  Is it not possible to trigger on Vote?
When trying to Compile All Classes, I am getting an Insufficient Privileges error.  This jsut started happening yesterday. 

Where can I start looking to figure out why this is happening?