You need to sign in to do that
Don't have an account?
Sulabh_Kapoor
Name of Months within the start and end dates
Hi,
PS: I am preparing a design so no code is written so far.
In my custom object, I store the start and end dates of a particular campaign, let's say start date is 01/01/2017, the end date is 03/31/2018. For these 15 months, I need to create an opportunity (one for each month) and need to mark the close date as the end date of every month. This process of Opportunity creation is going to happen through a trigger.
I would like to check if anyone has done something similar to this and can share a code snippet or provide the best practices around this.
Thanks.
PS: I am preparing a design so no code is written so far.
In my custom object, I store the start and end dates of a particular campaign, let's say start date is 01/01/2017, the end date is 03/31/2018. For these 15 months, I need to create an opportunity (one for each month) and need to mark the close date as the end date of every month. This process of Opportunity creation is going to happen through a trigger.
I would like to check if anyone has done something similar to this and can share a code snippet or provide the best practices around this.
Thanks.
All Answers
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_date.htm
Something like this should get you started: