Fetch Delivery Notes

Hello, I would like to fetch multiple delivery notes and have the delivery note items in the dnotes appear in a custom doctype called loading sheet . How do i go about this and is this possible through custom scripts, have tried multiple solutions but none are working.Any help is appreciated

Figured it out

Can you share what you did (it might help someone with a similar problem)