function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Caleb_SidelCaleb_Sidel 

Opportunity Probability and Forecast Category are not updating when setting Stage to Closed Won

Has anyone seen this issue.

 

I have a VF controller extension of Opportunity which does something very simple, it sets the oppty.StageName = 'Closed Won'; and then updates the oppty.

 

This all works fine, but today we noticed that the Probability is not being updated to be 100% and the Forecast Category is not being updated to Closed/Won.

 

All API documentation states that you only need to set the StageName. I've done this before, with data loader, apex, etc and not had a problem. But today I have a problem.

 

We tried flushing the browser cache, we tried forcing the probability = 100, but since Forecast Category is read/only we can't affect that.

 

The Apex class was API 18.0, we updated it to API 20.0 - no affect.

 

We tried putting a workflow behind the code, so that if the StageName = 'Closed Custom' (not a real stage) then have Workflow that does a field update to 'Closed Won' ==> results? It works!

 

But this is such a hack! Anyone run into this and/or a solution?

 

Thanks,

Caleb

 

 

jan.deschuttere1.3903161734252612E12jan.deschuttere1.3903161734252612E12
Hi Caleb

I don't know if you still need the answer to your problem after all these years but I've encountered the same issue and could not find any information or solution anywhere on the web to overcome the problem. 

If you are editting the StageName property through apex and the Forecast Category is not updating you can update the ForecastCategoryName property with the desired name. It is not a perfect fit (it involves some logic to keep it dynamic) but it does keep you in some control.

I hope this can help you and others.

Kind regards!
Jan