Fetching data through client script


I’ve a scenario where I added a custom button on Purchase Order, to add followup.
I want to fetch all the pending purchase orders of the supplier when user clicked the button and add them item wise to child table of followup doctype, so that user can update remarks he/she got from supplier.
I can’t figure out how to do it, any guidance will be greatly appreciated !