Fetching Sales Invoices in Journal Entry (Credit Note)

We have written a custom script in Journal Entry as follows:

//to fetch sales invoice ID from Sales Invoice to Journal Entry Accounts table.
cur_frm.add_fetch(“reference_name”,“po_no”,“supplier_invoice_no”);
cur_frm.add_fetch(“reference_name”,“po_date”,“invoice_date”);

However, we are unable to see any data in the Journal Entry table in order to adjust payment against sales invoices.

Please let us know where the problem lies.