How to add a child table after creating a new document using frappe.new_doc() in JavaScript?

@NCP Is there any way to set default values for all fields? For instance, if I add an item_code in the item table, is there a method to automatically set default values for all fields in the document, similar to triggering an event?