Hi! I’ve the following custom script working the way I want:
frappe.ui.form.on("SelectTestFilter", "tipoestado", function(frm) {
if(frm.doc.tipoestado == "Borrador/Finalizado")
{
set_field_options("estado", ["","Borrador","Finalizado"])
}
else if(frm.doc.tipoestado == "Activo/Inactivo")
{
set_field_options("estado", ["","Activo","Inactivo"])
}
});
The problem is that I want it to be available globally and not just targeting the “SelectTestFilter” doctype. Is there any way to do it?