I have written below client script to create a button on the ITEM PRICE page and to use it to interact with server script but it does not have any response when it is clicked
frappe.listview_settings['Item Price'] = {
onload: function(listview) {
// Add the Bingo button
listview.page.add_inner_button(__('Bingo'), function() {
frappe.msgprint(__('Bingo button clicked!'));
frappe.call({
method: 'custom_itemprice_action', // Ensure this matches the API Method name you defined
callback: function(response) {
if (response.message) {
frappe.msgprint(__('Response received: ' + response.message));
} else {
frappe.msgprint(__('No response message.'));
}
},
error: function(err) {
// Handle any errors
frappe.msgprint(__('Error: ') + err.message);
}
});
});
}
};
and this is the server script
def custom_itemprice_action():
# Your logic here
return "Successfully returned custom_itemprice_action"