i have a problem ill try to compute the number of days between posting date and due date. when i save the form i created the result will not show but when ill try to refresh the form it will show the answer.
i think i have a problem with my code.
$.each(cur_frm.doc.references || [], function(i, d) {
frappe.db.get_value(d.reference_doctype,d.reference_name,"due_date", function(value){
var diff_day = frappe.datetime.get_diff(value["due_date"], cur_frm.doc.posting_date);
frappe.model.set_value(d.doctype, d.name, "no_of_days_fr_delivery", diff_day);
});
});