Before change status first fill submit feedback form

When we click on submit feedback button this form open


now i want to before interviewer change the status ‘Rejected’ or ‘Cleared’ submit feedback form first and then change the status

if he don’t fill submit feedback form and try to change the status he will get an error that first fill submit feedback form firsr


how we can do it?

please apply it.

if the status is rejected and cleared, then it will trigger and set your scenario accordingly.

frappe.ui.form.on('Interview', {
    status: function(frm) {
        if (frm.doc.status == "Cleared" || frm.doc.status == "Rejected") {
            frappe.db.get_value("Interview Feedback", {"interview": frm.doc.name}, "name", function(value) {
                if (!value.name) {
                    frm.trigger("submit_feedback");
                }
            });
        }
    }
});

Write @NCP when i try to change the status cleared or reject then automatically open submit feedback form
can we add one message like please fill first feedback form

that for, you have to customize the whole submit_feedback function. otherwise remove it and set the message using the frappe.msgprint

frappe.msgprint("please fill first feedback form")

Write thats Correct Thank you @NCP

hi @ncp when i try to reject or cleared status show mi this message and in that message i write “Please fill out the Interview Feedback form by clicking on Submit Feedback Button” to show the submit feedback button every time we have to refresh the page then “submit feedback” button show
for that can we do anything
without refresh page show submit feedback button still show

when i reject or cleared status its show like this submit feedback button not there
when i refresh page now submit feedback button show

You have to write some logic according to the scenario and also check the core code to see how it works.