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 Angerami 16John Angerami 16 

Create multiple records from Master Record

I am trying to calculate Monthly Recurring Revenue based on an Opportunity.
MRR is its own Object that is connected to an Opportunity.
On the Opportunity I have three fields I think I need (Start Date, End Date, Term (in Months) ).
Goal is to have an MRR record created for each month from the Start to End Date.
So if the Start Date is 1/1/2016 and the End Date is 4/30/2016, I want four MRR records to be created:
January 2016, February 2016, March 2016, April 2016.

I think I can use a Visual Flow to accomplish this but need a few pointers
JeffreyStevensJeffreyStevens
I don't think you would want to use VF for this.  I think you should create a trigger on the Opportunity, and when it is Closed-won - or everytime it's changed (if you want to see the MRR for open oppty's).  Then you would take your start and end dates and write some code to create the new MRR records.

It's not quite a simple as it sounds. You will need to answer serveral qustions - like - What if the start on the 15th and end on the 30th?  What if they start on the 10/31 and end on 2/28?  Quite a few little gotya's like that.