Hi everyone, I have a complicated question.
We have an object called Project. This object contains te following fields:
- Project Name
- Start date
- End date
- Total project months
- Average revenue per month
We want to create a detail object that holds a record for each month within a project. So this Project Months object should have:
- Project Name (master-detail relationship)
- Month number (month number - year, a text field)
- Average revenue per month (formula field, automatically the avg revenue belonging to the related project)
So in short, when a project is created, there should be records created for each Project Month containing the project name, month number and revenue. So when a project has 12 months, 12 records should be automatically added to the object Project Month, each containing the project name, month number and revenue.
I'm looking for a smart and maintenance fiendly way to do this. Please advise!
1 risposta
assuming the number of months is variable, this would require a coded soltuion. You would create an apex trigger on the 'Project' object, that creates the child records.
It is a fairly simple logic, so should not cost too much to implement.
IF the nuber of months is more rigid and only has a few options, you could create a process builder or visual flow to create the records for you, but that would not be easy to maintain.