Sales order item amount

hi all.
i create custom field service_charge type = float in sales_order item. and i want to user input service_charge price by item. how can recalculate amount of item when user input or change value in this field.
by amount = amount + service_charge
I’am try to insert custom scrirpt but amount field of item recalculate change when save only. not recalculate amount when change value on item.

i want to recalculate amount same as qty or rate?

help me pls.

In the search bar, type in “New Custom Script”, enter “Sales Order” for the doctype, and create a custom script.

There are many examples of scripts in this forum, for example Computation of total quantity in delivery note form

thank’s crafter
I’am will try this

i’m try this but when change value in field service_charge and enter not show new total amount in row.
total amount in row is change when save only

i wan’t to see new total amount in row when change value in field service_chare before save.

help me pls.

Post your code. This may help someone provide an answer.