Hi, Everyone
Use Case
- I have create one HTML field as drop-down.
- Using Jquery I have fill the all mobile numbers in that drop-down.
but error is that after save the document data not shown.
frappe.ui.form.on('Call Disposition', {
lead: function(frm) {
var number_list = [ ];
var number_list_value= [ ];
frappe.call({
method: "frappe.client.get_list",
args: {
doctype: "Lead",
fields: ['primary_phone', 'mobile'],
filters: {
name: cur_frm.doc.lead,
},
},
callback: function(r) {
number_list = r.message;
var options = number_list[0];
number_list_value= Array.from(Object.keys(options), k => options[k]);
number_list_value=number_list_value.filter(Boolean);
var x = document.getElementById("myList");
$('option', x).remove();
var option = document.createElement("option");
$.each(number_list_value,function(k,v){
var option = new Option(v,v);
x.append(option);
})
}
});
}
});