trying to create journal entry with 2 rows in accounts table ,how to set value by index?
function create_Return(frm){
frappe.model.with_doctype('Journal Entry', function() {
var journalEntry = frappe.model.get_new_doc('Journal Entry');
var childTable = frappe.model.add_child(journalEntry, 'accounts');
childTable[0].account=frm.doc.paid_to,
childTable[0].debit=frm.doc.paid_amount
childTable[1].account=frm.doc.paid_from
childTable[1].credit=frm.doc.paid_amount
}
childTable[0].account
returns error on console 'TypeError: Cannot set property ‘account’ of undefined
how to set the 2 rows values?