You need to sign in to do that
Don't have an account?
Dragon Slayer
Compare forecast from different dates
I want to compare forecast from two different dates e.g. I want to compare today's forecast and tomorrow's forecast and see if the forecast category has changed for any of the records and highlight it. I want to do it on a daily basis so want to automate it. Is it possible and if so then how?
You can do it using a workflow or through an apex trigger.
Workflow:
1.) Create 2 custom fields on opportunity "Forecast Change Date" and "Changed from Forecast category".
2.) Create a workflow rule on opportunity to trigger whenever Forecast Category is changed.
3.) Add 2 field updates on the workflow, one to update "Forecast Change Date" with the current date, and other to update the "Changed from Forecast category" with the old forecast category.
4.) Run a report on opportunities to monitor the changes based on dates.
5.) Please note, this will only track the last change, and not all the changes.
Trigger:
1.) Create a custom object like "Forecast Change".
2.) Write an apex trigger on opportunity to create a "Forecast Change" record with necessary fields, whenever the Forecast Category is changed.
3.) Run a report on Forecast Change records for monitoring.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.
Thanks,
Shashank
All Answers
You can do it using a workflow or through an apex trigger.
Workflow:
1.) Create 2 custom fields on opportunity "Forecast Change Date" and "Changed from Forecast category".
2.) Create a workflow rule on opportunity to trigger whenever Forecast Category is changed.
3.) Add 2 field updates on the workflow, one to update "Forecast Change Date" with the current date, and other to update the "Changed from Forecast category" with the old forecast category.
4.) Run a report on opportunities to monitor the changes based on dates.
5.) Please note, this will only track the last change, and not all the changes.
Trigger:
1.) Create a custom object like "Forecast Change".
2.) Write an apex trigger on opportunity to create a "Forecast Change" record with necessary fields, whenever the Forecast Category is changed.
3.) Run a report on Forecast Change records for monitoring.
If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.
Thanks,
Shashank
Looks like your reply is deleted. Please use the TEXT() function to use the correct picklist values within formulas in Salesforce.
e.g.:
Use TEXT( (ForecastCategoryName) ) instead of JUST ForecastCategoryName
Use TEXT( PRIORVALUE(ForecastCategoryName) ) instead of PRIORVALUE(ForecastCategoryName)
Thanks,
Shashank
I figured out that I had to use TEXT() that is why I deleted the question :)
I was able to compare the forecasts using the workflow, didn't try using the Trigger though.
Thanks a lot for your suggestion!
As a part of the same task, I am trying to convert the Opportunity Amount using the ConvertCurrency function. I used ConvertCUrrency(Amount), but I am getting "Error: Incorrect parameter type for function 'convertCurrency()'. Expected Currency, received Number" even though the type of Amount field is Currency. Any idea why is it so and how can I fix it?
Thanks in advance!
For ConvertCurrency() to work, the org needs to have multi-currency enabled. Can you check if that is enabled for the org?
Thanks,
Shashank
Multi-Currency is already enabled for my organization.
Thanks!