I would like to know is there any way to change default property of link field in doctype.
my use case is i want fill child table in student batch with data supplied to via URL
for testing that i have wrote a some code in student_batch.js which is this
console.log(get_url_arg("name").split(","));
frappe.model.set_value(frm.cdt, frm.cdn, "student_name", "sasi");
var x = frm.add_child("students");
x.student = "AP00002";
frm.refresh_fields();
}
so when i load student batch doctype
i will get this
but when i submit i get this error
this is because child table field has link filed which is linked to student doctype but prefilled value if from student doctype
so i want to change this link property only when there is value in url parameter
please help me