You need to sign in to do that
Don't have an account?
Alan_Ruan
change Idea status base on vote
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';
}
}
}
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';
}
}
}
Status would be changed to 'Voted' when if condition matches. The code will work fine,