• Alan_Ruan
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Dear Experts,

I have a schedule job working fine in Sandbox but not in production. Would you please help to take a look and advise?
 
global class rm_ScheduledDeleteInvalidLead Implements Schedulable {

    global void execute(SchedulableContext sc) {

        massDeleteLead();

    }

    public void massDeleteLead() {
        List <lead> leadtoDelete = [Select Id FROM lead WHERE Firstname = 'Unknown' and Lastname = 't.b.d.' and (email = 'unknown@example.com' or email = '') and CreatedDate < LAST_N_DAYS:30];
        delete leadtoDelete;
    }


}

 
Dear Expert.

I need to change Idea status base on number of Vote. I'm new to Apex, could you please advise why my code is not working?

trigger updateStatusbyVote on Idea (before update,before insert) {
for (Idea updatedIdea : Trigger.new) {
       if (updatedIdea.VoteTotal > 10) {
        updatedIdea.Status = 'Voted';
       }
}
}
Dear Expert.

I need to change Idea status base on number of Vote. I'm new to Apex, could you please advise why my code is not working?

trigger updateStatusbyVote on Idea (before update,before insert) {
for (Idea updatedIdea : Trigger.new) {
       if (updatedIdea.VoteTotal > 10) {
        updatedIdea.Status = 'Voted';
       }
}
}