How to assign value to custom field

@Ram_Gopal_Rao can you explain what is done by this script doc.domestic_sales|sum(attribute='total_insured')

If you want to set value in form then you can use use cur_frm.set_value(field, value)

Also note that, field name total_value will be in double quote.
You can test this script

cur_frm.set_value("total_value",100);