Fetch Item detail from other Doc type

Hi, Can anyone help me to fetch item detail from other doc type. In my case I need to fetch Item detail from Stock Entry in Sale Order, purpose- we are in repair industry, to inward material we do Stock Entry(material Receipt) but to proceed further Sale order need to be create. But here user is doing same item entry again. So to avoid that, I want to fetch stock entry directly to Sale order. I am able to call Stock Entry no. by simply creating a custom field Stock entry as link field but now want to create button to fetch item detail.

Can anyone help me with this or give script for same.

May not work out of box but your script should look something like this…

You need to put this in custom script for sales order.