@frappe.whitelist()
def enroll_student(source_name):
 student = get_mapped_doc(u'Student Applicant', source_name, {u'Student Applicant': {u'doctype': u'Student', u'field_map': {u'name': u'student_applicant'}}}, ignore_permissions=True)
 student.save()
 program_enrollment = frappe.new_doc(u'Program Enrollment')
 program_enrollment.student = student.name
 program_enrollment.student_name = student.title
 program_enrollment.program = frappe.db.get_value(u'Student Applicant', source_name, u'program')
 return program_enrollment

@ frappe . whitelist ( ) def enroll_student ( source_name ) : student = get_mapped_doc ( u'Student Applicant' , source_name , { u'Student Applicant' : { u'doctype' : u'Student' , u'field_map' : { u'name' : u'student_applicant' } } } , ignore_permissions = True ) student . save ( ) program_enrollment = frappe . new_doc ( u'Program Enrollment' ) program_enrollment . student = student . name program_enrollment . student_name = student . title program_enrollment . program = frappe . db . get_value ( u'Student Applicant' , source_name , u'program' ) return program_enrollment
creates a student record and returns a program enrollment .