Hello,
I'm hoping someone can point me in the right direction. It seems like after our 5th (6th on...) related record entry into our Spending/Expenditures table, our project is unable to update and sync formulas that total our actual cost. Is this a limitation of the related tables? We do have projects with more than 5 related records in our "Spending" table.
Thanks in advance!
Currently we do not have any projects with more than three expenditures. If I have time in the next week, I will test our setup to see what 5+ related records do.
Hi Andy!
I've actually modified the expressions similar to @Joshua-Young to sum the expenditures in the spending table and update the "actcost" field in the projects table, so it has been customized from the original solution. Project Expenditures Sum "ActCost" Discussion
Our customized pop-up:
Table in map pop-up is responsive, but the "actcost" field doesn't seem to be responsive. It is likely my code or a oddity about related records that I'm not aware of?
The arcade expression in the form SHOULD in theory sum the "costamount" values entered via the Spending table and populate the "actcost" field in the related Project table record.
Hi Leah,
Thanks for the clarification.
Is the form expression you are using the one in the linked post to populate the actcost field?
At first glance, this should work. The one thing I see in it though is that it is subtracting the total of the expenditures from the estimated budget. Looking at the popup you shared, it appears that this combination could result in odd results.
If you don't care about the total remaining (ie, estimated cost minus the expenditures), then the code below should work fine.
var expendituresFS = FeatureSetByRelationshipName($feature, "Spending");
var actcost = Sum(expendituresFS , 'costamount')
return actcost
As far as limitations for how many records can be pulled, there shouldn't be any. As silly as it sounds, it may be worth clearing your cache and seeing if that fixes anything.