Hello @ArundhatiS, Thank you for caring to respond. I discarded my previous script and been looking for it. Meantime I’m looking at the closest method I’ve found and will revert soon as I get somewhere:
Unable to handle success response desk.min.js:1473:4
I think my problem is my trigger.
Inability to link the Payment Entry to the related invoice. The invoice number comes through the references table. It would be possible to pick it from there into a trigger field, but It’d still need to relate it to a corresponding field in the invoice, this field is not among the table items of the Invoice DocType. Or is it?
Secondly, I just think there must be a better way to this problem. Perhaps an inbuilt method within Frappe. Need someone with more experience to help out.
This solution will go a long way for many users.
Turns out the problem really is my trigger. Placing console.log(invoice); above the $each loop shows its null.