How to over ride default property of link field

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

		frappe.model.set_value(frm.cdt, frm.cdn, "student_name", "sasi");
		var x = frm.add_child("students");
		x.student = "AP00002";

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

Hi @shahid_ecit,
We have deprecated the Student Batch. Now student group and student batch are merged and single doctype of the student group is there with more additional functionality. You can now update the student group without manually adding the students (which I hope resolved your test case)


We have deprecated the Student Batch.

you mean in erpnext 8

yes, in version 8. There, you can directly update student group from program enrollment.

@ManasSolanki i am developing with v7 please help

Yeah sure, What exactly is your use case?
But since school domain is currently under heavy development and soon will be linked to the account domain of the erpnext, so I 'll advise upgrading.