Fetch the latest entry created in a doctype order by the latest date field

Thank you for this @peterg will take a look at this link after.
in the meantime I will test this first

frappe.ui.form.on("Monitoring", {
    "refresh": function(frm) {
        frappe.db.get_list("Monitoring", {fields: ['*'], order_by: "creation desc", limit: 1}).then((result) => {
            frm.set_value({"fieldnew1": result.field1, "fieldnew2": result.field2 })
            frm.save();
        }
    }
});