I can’t seem to get frappe.route_options
to actually populate from my dialog.
Here’s the origin code:
primary_action: function(){
var args = d.get_values();
//console.log(args);
if(!args) return;
if(cur_frm.animal_status == 'Processed') {
frappe.throw("This animal is already marked as processed")
} else {
new_process_animal = frappe.model.make_new_doc_and_get_name("Process Animal");
frappe.route_options =
{ "animal": cur_frm.doc.animal_identifier,
"bom_repack": args.bom_repack,
"animal_barcode": cur_frm.doc.animal_id_number,
"hanging_weight": args.hanging_weight,
"live_weight": args.live_weight,
"process_date": args.process_date
};
//console.log(frappe.route_options);
frappe.set_route("Form", "Process Animal", new_process_animal);
}
cur_frm.set_value('animal_status', 'Processed');
cur_frm.save();
}
So from there it won’t populate the destination from fields, but it brings the object (correctly) with it.
What am I doing wrong?