User Story
As a Salesforce Admin,
I want a method to automatically set the Close Date of Opportunities so that each Opportunity is n
days ahead of the previous one,
So that I can ensure orderly and sequential opportunity Close Dates while following best practices.
Acceptance Criteria:
- The solution must be implemented in a utility class named
OpportunityUtility
.
- The method
SetSequentialCloseDates(Integer NDays)
should allow specifying the gap (n
days) between the Close Dates of consecutive Opportunities.
- The first Opportunity in the list should retain its original Close Date.
- For each subsequent Opportunity in the list, the Close Date should be incremented by
n
days relative to the previous Opportunity.
- The method should ensure that updates are only applied to Opportunities with non-null Close Dates and that the Opportunities are processed in ascending order of their current Close Date.