JS code for ignoring related doctypes to allow cancel of doc form

Hello there! I’m a newbie. Can anyone help me with the problem in ignoring related doctypes so that it will allow the user to cancel a document or a data? Any ideas and tutorial is a big help to me thank you!

Try this

frappe.ui.form.on('Your Doctype', {
    setup(frm){
        frm.ignore_doctypes_on_cancel_all = ["Doctype To Ignore"];
    },
})