Auto fetching fees from program to program enrollment

How do i auto fetch fees from program child table fees on enrollment

Program doesn’t have a Fees child table, though it would certainly be a nice addition. You’d have to add the field and write code to pull the data when a new program enrollment is created.

thanks peter have already created a child table in program based of child table program fee though i facing a challenge with writing a code to pull information on enrollment


i added a child table for fees in program check on row 7

Someone help please

This will take some coding know-how. I’m out right now and can’t really help with specifics, but these docs would be a good place to start:

https://frappeframework.com/docs/v13/user/en/api/form

i wrote a script though this script isn’t working when using program enrollment tool but on enrolling one student its picking the fees. could you help on this.
console.log(r)
frm.doc.fees = []
var amount = 0;
var student_category = “”;
$.each(r.message,function(_i,e){
let entry = frm.add_child(“fees”);
entry.fee_structure = e.fee_structure
entry.due_date = e.due_date
entry.student_category = e.student_category
entry.amount = e.amount
})
refresh_field(“fees”)