How to fetch cancelled opportunity documents

Hi @pm23,

Please check the syntax and apply it according to the scenario.

frappe.ui.form.on('Opportunity', {
    refresh(frm) {
        frappe.db.get_list('Opportunity', {
            filters: { 'docstatus': 2},
            fields: ['name'],
            limit: null
        }).then(oppo => {
            oppo.forEach(val => {
                console.log("---------", val)
            });
        });
    }
});

Thank You!