Refreshing child table after adding data to it

I have added some data to student batch student child table from student applicant doctype and then loaded student batch i am getting nothing in child table when i load the page but when i reload i was able to see data that i added

and i have done

in student batch.js on onload function but i am not able to get any data on onload but if i refresh i was able to get data
can any please help me with this please

code that i used to add data to child table is

def add_to_student_batch(name_of_student,id_of_student,parent):
	doc = frappe.get_doc({
			"doctype":"Student Batch Student",
			"parenttype":"Student Batch",
		return "success"


Can you share the custom script which is calling add_to_student_batch method


var selectStudentIdFromStudentDocType = function(){{
		method: "erpnext.schools.doctype.student_applicant.student_applicant.get_name_if_enrolled_empty_if_not",
		args: {
			name_of_student: JSON.stringify(getIdsFromList())
		callback: function(r){
				stud_id = [];
				stud_name = [];
				x = 0;
				res = JSON.parse(r.message);
			    var no_of_res = JSON.parse(r.message).length;
			    for (i=0;i<no_of_res;i++){
			    	// checks  and counts selected students who are not enrolled
			    	if(res[i].length == 0){
			    		x = x+1;
			    	 frappe.throw("Please Enroll the Selected Student Applicants before adding to a Batch");
			   	frappe.model.with_doctype("Student Batch", function() {
					var tlb = frappe.model.get_doc("Student Batch");
					$.each(stud_id, function(i, d) {
						var detail = frappe.model.get_new_doc("Student Batch Student", tlb,
						$.extend(detail, {
							"student": d,
							"student_name": stud_name[i],
					frappe.set_route("Form", "Student Batch/App Builder-abcd-2017-18");

and definition of

var addStudentDetails = function(stdId,stdName){{
		method: "erpnext.schools.doctype.student_applicant.student_applicant.add_to_student_batch",
			parent:"App Builder-abcd-2017-18"
		callback: function(r){}


Try this

@vivin_joseph it not working

@makarand_b is there any hope on this please help