What I need is basically a Roll-up summery field, just it needs to be a bit more advanced.
Here's what I'm trying to accomplish
We have a custom object called 'Bank Statements' with a Master-Detail relationship with Opportunities. Each Opportunity can have many Bank Statements, one record for each month. The Statement records contain fields such as Average Balance and Negative days for a Date field so we can know which month the statement is for.
Now we want to make a field on the Opportunity called 'Recent Month Negative Days' which essentially needs to look at all the detail records and return the 'Negative days' from the detail record with the most recent statement date.
So for example if the was a statement with date from July, August and September it should return the Negative days from the record with the August date.
With the current roll-up summery field options, there is no way to add logic like this only static field filtering.
I have attached a screenshot of the bank statement details records on the Opportunity (We're using GridBuddy)
3 risposte