Payment entry error after adding custom script

Custom Script in Payment Entry:

cur_frm.add_fetch(“purchase_invoice”,“bill_no”,“bill_no”);

Script error in Payment entry after a refresh:

SyntaxError: Invalid or unexpected token
at Class.setup (http://192.168.1.240/assets/js/form.min.js?ver=1531735239.0:2691:18)
at _f.Frm.setup (http://192.168.1.240/assets/js/form.min.js?ver=1531735239.0:172:22)
at _f.Frm.refresh (http://192.168.1.240/assets/js/form.min.js?ver=1531735239.0:446:9)
at Class.load (http://192.168.1.240/assets/js/form.min.js?ver=1531735239.0:87:33)
at http://192.168.1.240/assets/js/form.min.js?ver=1531735239.0:82:7
at Object.callback (http://192.168.1.240/assets/js/desk.min.js?ver=1531735239.0:5516:6)
at Object.callback [as success_callback] (http://192.168.1.240/assets/js/desk.min.js?ver=1531735239.0:1437:16)
at _ (http://192.168.1.240/assets/js/desk.min.js?ver=1531735239.0:1461:34)
at Object. (http://192.168.1.240/assets/js/desk.min.js?ver=1531735239.0:1562:5)
at i (http://192.168.1.240/assets/frappe/js/lib/jquery/jquery.min.js:2:27151)

Why the error?

Please share your custom script and your use case.

My use case is to have Supplier Invoice No fetched from Purchase Invoice to Payment Entry Reference. My custom script is

cur_frm.add_fetch(“purchase_invoice”,“bill_no”,“bill_no”);

in Payment Entry doctype.

Check what is the name of the document. Does it match with your Supplier Invoice No or is it something else. Please upload a screenshot of this area like I did, top of the document right side just under your User Name

image

Does that name mentioned here is your Supplier’s Invoice No or not ?

That is not the Supplier Invoice No.

This is what i mean.

This is found under Purchase Invoice → Supplier Invoice Details. User inputs this information. I want this to also reflect in Payment Entry for multiple Invoices added to the list.

This means the compiler can’t parse and make sense of your code - say on this line?

at i (http://192.168.1.240/assets/frappe/js/lib/jquery/jquery.min.js:2:27151)

1 Like

If the syntax error is unreasonable or persists, run ‘bench build’ to recompile the JS code - that may resolve the error?

1 Like