Payment entry error after adding custom script

Custom Script in Payment Entry:


Script error in Payment entry after a refresh:

SyntaxError: Invalid or unexpected token
at Class.setup (
at _f.Frm.setup (
at _f.Frm.refresh (
at Class.load (
at Object.callback (
at Object.callback [as success_callback] (
at _ (
at Object. (
at i (

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


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


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 (

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