Show custom field in Payment Entry Reference

HI,
I have a custom field in “Sales Invoice” and would like to show this field automatically as part of reference table in Payment Entry". Here is what I have done.

Form: Sales Invoice
Custom Field name: po_no
Type: Data

Form: Payment Entry Reference
Custom Field name: po_no
Type: Data

I am using the same custom variable from ‘Sales Order’ to ‘Sales Invoice’. Its working fine when i am giving the same field name in ‘Sales Invoice’.

Form: Sales Order
Custom Field name: po_no
Type: Data

Form: Sales Invoice
Custom Field name: po_no
Type: Data

Like this. But don’t why its not showing in the Payment Entry Reference.

Can anyone please help.

Thanks!

Hi,
The Payment entry reference is a child table and fetching data from parent doctype to child table require custom scripting. Please refer the link below for custom script examples.
https://erpnext.org/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples
Hope this helps.

Hi thanks for the reply. Can you please provide a sample for this scenario?

I tried with the custom script but its not working… can someone please help…
This is what i have given…

cur_frm.add_fetch(“sales_invoice”, “po_no”, “po_no”);

please correct if i am wrong