Fetch" item_code" from items table to custom table B,both table are under quotation

Can anyone please show me how to write a custom script on doing the following.

Since the products my company selling have a lot of attribute, and i have to show those attributes on the from when creating doctypes eg: Quotation, Sales Order, Sales Invoice etc.

Due to the columns can be shown on quotation item table is limitting, thus i created a doctype called “doctypeXX”.
In doctypeXX, the first field is called"item_code", which is a link field connectted to doctype Item, doctypeXX also contains some other fields from Item tables which hope to show on quotation form.

So, now in Quotaion, i have 2 tables, one is"quotaion item" aka “items”, the other one is labeled “My Spec” (field name is “my_spec”, option is set to "docypeXX)

What i am trying to do is, when I add a new row to quotation item table, i want it atuo creat a new row on My Spec table corresponing to the same item_code.

Hi @Terry! With regards to your requirement, why not create the attribute fields in the item row itself? Information will be easier to pick up and show it under the items you are working on rather than populating another child table. Just a thought though.

Thanks for the reply @creamdory.
Actually all fields are under item master already, what I am trying to do is to show these extra attribute fields on the quotation, sales order and invoice form for one sight checking.