Hi
I am writing some custom coding for listview.
It seems that, no matter how many items I actually select, my code…
frappe.listview_settings['Task'] = {
onload: function(listview) {
listview.page.add_inner_button(__('Add Expected Times'), function() {
let selected_items = listview.get_checked_items();
if (selected_items.length >= 1) {
let total_expected_time = 0;
debugger;
frappe.call({
method: "frappe.client.get_list",
args: {
doctype: "Task",
filters: {
name: ["in", selected_items.map(item => item.name)]
},
fields: ["expected_time"]
},
callback: function(response) {
let tasks = response.message;
debugger;
tasks.forEach(task => {
debugger;
if (task.expected_time) {
time = task.expected_time;
total_expected_time += time ; // Ensure that undefined values are treated as 0
debugger;
}
});
frappe.show_alert({
message: `Total Expected Time: ${total_expected_time} hours`,
indicator: "green"
});
}
});
} else {
frappe.show_alert({
message: "Please select at least one Task.",
indicator: "orange"
});
}
});
}
};
Only allows a max of 20 items ??
Is there a way to increase this ?