Question: Dynamically insert doctype - child table

Hello Friends
I have a doctype that is a child table. I need to insert it dynamically many times depeneding on a condition, into the parent. Is frappe.get_doc(…).insert, the correct choice? any pointers. Thanks

Not quite sure what you are trying to do Just check Journal Entry.
In case it did not help let us know what you are trying to achieve.

Hi Neil, thank you for the reply. I want to link multiple order line doctype(child) to Sales Order (Parent). The requirement is, the user receives the order, the order may contain many items to be delievered on different dates. This means we have to tie the order items to delivery date. Need to add a button like add-new order line in the sales order for example

Kindly let me know if this is doable with the framework?
thanks in advance Neil. I will check Journal Entry.

Usually the above case would be handled by multiple sales orders.

Alternatively the Sales Order could have a line item specific ship date, much like the Purchase Order does.

Thanks for the reply. Yes I think it has to be custom written not out of the box as I understand