You can use the power of automatic formula recalculation within the table to sum the total credits.
The formula will automatically get recalculated whenever data in the transaction table changes - including when rows are added, when they are deleted, and when the value in the Credits column changes. There is no need for you to write any automation, or do any other special handling.
The best way to do this is to specify a Column formula. You can do this by selecting the Total Credits column (click in the column header), and then pressing the Formats button in the toolbar, and specify the following Column Formula:
=SUM(Filter(Transactions,"Transactions[ClientID]=%",[ClientID])[Credits])
This sets the formula for each cell in the TotalCredits column to have the above formula. The way this formula works is the following - shown in parts. The inner Filter is:
Filter(Transactions,"Transactions[ClientID]=%",[ClientID])
The above Filter formula collects all of the rows from the Transactions table. If you were to add a column in the Clients table with the above formula, you will see a filter with the matching rows.
We then sum the Credits column for all matching rows of the filter expression as follows:
=SUM(FilterExpression[Credits])
This will sum the Credits column from the filtered expression and place the value in the Clients table column.
Once you have specified this as a Column Formula, then changes in the Transaction table will result in a recalculation, and automatically get updated - no other special handling is needed.
Hope this helps.
Thanks,
Razi
PS. Generally we recommend using Rowlinks in Honeycode instead of ID's.