Route Option to child Table items

using below code i can create a new doc from sales order and map parent doc filed like customer i need to map sales order item child table fields like qty to a new document
any idea

frappe.ui.form.on(“Sales Order”, {
refresh: function(frm) {
frm.add_custom_button(__(“Reservation”), function() {
frappe.route_options = {
“reserved_to”: frm.doc.customer
frappe.new_doc(“Stock Entry”);
}, __(“Create”));

Try to un tasks serially, use

var sales_order_items = frm.doc.items frappe.run_serially([ () => frappe.new_doc('Stock Entry'), () => { for (let i in sales_order_items){ cur_frm.add_child("items", { item_code : sales_order_items[i].item_code}) } }], () => next action you want to perform);

Dear @Mohammad_Ahmad_Zulfi thanks for your response i try to compile your suggestion with my code but still not work if you have any suggestion for the complete code please share it with me