I have a Model called Parent with zero or three records, with with an “Allowed” number field in salesforce.
I have a Model called Child, related to the Parent model as you would expect. For each row in the Parent model there may be up to a dozen or so rows in the child model. The Child model has a “Used” number field in salesforce.
I want to display a table of the Child model with a ui-only formula field that shows a “Remaining” value.
Suppose the data in Parent looks like this:
Row | Name | Allowed
1 | A | 10
2 | B | 5
And the data in Child looks like this:
Row | Parent | Used
1 | A | 2
2 | A | 1
3 | A | 5
4 | B | 4
5 | A | 12
Is there any way I can write a ui-only formula so that I can display a table on the Child model that looks something like this?
Row | Parent | Used | Remaining
1 | A | 2 | 8 (=10-2)
2 | A | 1 | 7 (=8-1)
3 | A | 5 | 2 (=7-5)
4 | B | 4 | 1 (=5-4)
5 | A | 5 | 0 (=MAX(2-5,0))