Sum of child table in custom field

Hi,

I am trying to sum up the values in a column and see the results in a custom doc. I have no experience scripting and would love some help on how to go about this.

This is my table: I would like to sum the last column (value_of_produced) and the sum to appear in the field Total Production Value (total_value_of_produced). The child table is industries_output and the doc is called Industries Daily Production Log.