I am using the standard user object and a custom object called "leave". The user object has a custom "starting leave balance" field, which is data from our legacy system (lets call this static field). I also have a helper formula which calculates the accrual rate (lets call this dynamic field).
The leave object record form has "number of business days" field, which subtracts from the total leave balance. So the formula here for leave balance = static field + helper formula - sum of "number of business days".
The problem is that I don't know how to sum all records for a specific user when it is not a parent-child relationship. Right now, this only works on the first record submitted, as the second one will show the same leave balance as the first because it's not adding the previous record.
Is there a sum all records function without parent child relationship? Or do I have to change the data model?
Please note: I can only use declarative tools.