Populating Parent Field Info to Child Table Field for Journal Entry

Hi,

I want to populate a value ‘Project’ (custom field added) from Journal Entry to Journal Entry Account Project field (standard). I have written a custom scrip but its not working as well. Please guide:

frappe.ui.form.on(‘Journal Entry Account’, ‘validate’, function(frm, cdt, cdn) {
var tbl = frm.doc.items || [];
var i = tbl.length;
var child = locals[cdt][cdn];
while (i–) {
{frm.doc.items[i].project = project;
frm.refresh_field(“items”) }}})

Can anyone help?