guizox
April 10, 2017, 5:05pm
1
Hello.
I need to add one new child in the table below in the picture and I’m having a lot of problems.
I would like to do this in my custom script.
How can I do this?
I have the name of the fee_Structure as Student Program and I need to create the row in the table.
I saw some samples but nothing concret.
I saw this one telling me how to add a child, but I don’t know the method that I need to pass :
Try this:
frappe.ui.form.on("Item", "validate", function(frm) {
var d = frm.doc;
frappe.call({
method:"erpnext.stock.Stock_custom_methods.check_eq_items",
args: {
doc: frm.doc
},
callback:function(r){
//if(r.message == "item not in table"){
var new_row = frm.add_child("engine_compatibility_");
new_row.name = d.item_code;
new_row.item_name = d.item_name;
new_row.item_gr…
Looking at this document, I saw some informations about the fee_structure:
frappe.github.io/erpnext/current/models/schools/fee_structure
Could you please help me with this giving me some example?
Thank you!
What have you tried? Please share your code.
guizox
April 11, 2017, 12:08pm
3
hey @netchampfaris .
I’m trying to get the information for the fee_structure in this first moment.
I’m using this :
frappe.ui.form.on(“Program Enrollment”, “student”, function(frm) {
var kindOfStudent = frm.doc.application_status;
if (kindOfStudent == “New Student”){
frm.set_value(‘academic_year’, “33 Weeks”);
} else {
frm.set_value(‘academic_year’, “33 weeks renewal”);
}
var d = frm.doc;
frappe.call({
method:“erpnext.schools.doctype.fee_structure.fee_structure”,
args: {
doc: frm.doc
},
callback:function(r){
console.log(r);
}
});
});
But the answer is been 404 error, page not found.
I think my problem is the url that i’m passing in the method.