Problem with overwriting

In a doctype there is already data for a row, lets say “Quantity” contains value ‘0’. In the backed I am editing the same “Quantity” in the database as some value ‘125’. Now after saving the doc value ‘0’ is shown instead of ‘125’. Is there a way to prevent this overwriting. Please help.

hello @ZodEnIX how are you trying to update the value ? Are you directly writing into database or changing its value through your code. you should not run any insert or update query directly in back-end, instead you should assign your desired value through your code.