I need Sales Order items to fetch to a custom doctype

Hi Friends,
I need Sales order items fetch to custom doctype name “Delivery by Driver”, I connected the delivery by driver with sales order by document links but cou;ld not able to fetch Sales order items!

Syntax error is coming please give client script for delivery by driver (custom doctype) getting the item table from Sales order