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
John Chalovich 6John Chalovich 6 

Change opportunity stage history with a trigger?

I am an Admin with no coding/developer skills, and we don't have a developer. Salesforce Support told me that my problem could be solved by setting a trigger to manually update stage history. I'm hoping someone can explain how to do this.

Basically, my team created an opportunity in July '18 that shouldn't have been created until December '18, and I need it to show up as created in December '18 with the stage set to Evaluation in December, as well.

2 days ago (January '19), I deleted the original opportunity and created a new opportunity through import with the CreatedDate set to December 12, 2018, with the stage set to Evaluation. However, while the opportunity correctly appears as having been created in December, the stage value is not set until January. Therefore, the opportunity is missing from my Opportunity Trend report in december, because it is considered stageless until January.

Can someone tell me how to create a trigger that will set the opportunity stage history to show the evaluation stage being set in December? Thank you!
ShikibuShikibu
The opportunity stage history is intended to tell the truth, so I'm afraid you are not going to be able to make it lie. Also, this problem does not seem to have anything to do with triggers.