I am working on a requirement where a particular account should have only four contacts if more than four contacts then a validation error should pop up.
Since a roll-up summary is impossible as there is no master detail relation I tried an alternative way using flow builder.
I created a field named ContactTotal(number field) and a record-triggered flow for this.
Here I am getting the number of current contacts and adding it to the earlier created number field. This works fine for creating the record condition as I specified the triggering condition.
Can I do something in the flow to update the value if the record is deleted as well?
Also, the number field total contact has an initial value as blank instead of the number of contacts which gets updated when a record is created, but until then it remains blank. Is there any solution for this too?