You need to sign in to do that
Don't have an account?
Paulien van der Krift 9
How to create a detail object with one record per project month?
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!
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!
The only way i can think of is by creating a trigger on Project with After Insert event and creating records for Project Month. Do you want a code snippet?
Thanks.
@megna yes please, thanks!
Thanks
If the issue is solved please mark it as solved.
Thanks