You need to sign in to do that
Don't have an account?
Setting probability percentage based on Amount field in Opps.
Our sales forecasts tend to be off because the renewal opportunity probability default is 65%. We'd like to change these defaults to different percentages based on the Opportunity Amount field for Opps in the proposal stage:
65% for Opp. amounts less than $5K
80% for $5k -15k
85% for $15k - 99k
95% for > $100K
We have an apex trigger that deals with our probabilities. Right now, it has some logic for the Closed opps:
//NEW:
//changed this trigger to only reset the probability on closed won, lost opps.
Map<String, Integer> closeMap = new Map<String, Integer>();
closeMap.put('Closed Won', 100);
closeMap.put('Closed Lost', 0);
closeMap.put('Closed Funnel Purge', 0);
for (Integer i = 0; i < Trigger.new.size(); i++) {
if (closeMap.containsKey(Trigger.new[i].StageName)) {
Trigger.new[i].Probability = closeMap.get(Trigger.new[i].StageName);
}
}
So, I need to build from here. Any suggestions?
Thanks,
Julien
if (oprt.Type == 'Renewal'){
if (oprt.StageName == 'Proposal'){
if (oprt.Amount <= 5000){
oprt.Probability = 65;
}
}
}
if (oprt.Type == 'Renewal'){
if (oprt.StageName == 'Proposal'){
if (oprt.Amount >= 5000){
} else if (oprt.Amount <= 15000){
oprt.Probability = 80;
}
}
}
if (oprt.Type == 'Renewal'){
if (oprt.StageName == 'Proposal'){
if (oprt.Amount >= 15000){
} else if (oprt.Amount <= 100000){
oprt.Probability = 85;
}
}
}
if (oprt.Type == 'Renewal'){
if (oprt.StageName == 'Proposal'){
if (oprt.Amount >= 100000){
oprt.Probability = 90;
}
}
}