Hello,
I am trying to fetch opportunity documents which are cancelled but I am not getting success. What I come across is even when document is cancelled there status is open. See below
So now how I can get document which are cancelled? What are ways?
Below is my simple client script where i am trying…
frappe.ui.form.on(‘Opportunity’, {
refresh(frm) {
frappe.call({
method: ‘frappe.client.get_list’,
args: {
doctype: ‘Opportunity’,
fields: [‘name’],
filters: {
‘status’: ‘Cancelled’
}
},
callback: function(response) {
if (response.message) {
var cancelledOpportunities = response.message;
console.log(‘Cancelled Opportunities:’, cancelledOpportunities);
} else {
console.log(‘No cancelled Opportunities found.’);
}
}
});
}
});