Delete all data from child table on Single Paged Doc Load

How can I delete all the rows of child table everytime a single doctype is opened. Like let say first time I opened and inserted 7 records and saved it. Next time when I opened it again, I want all previous fields to be removed. How to achieve so?

This Worked For Me

cur_frm.clear_table("table_name")
cur_frm.refresh_fields();
3 Likes