Disable ability to send emails from docType based on workflow status

Hi all,

Using a client I would like to remove the ability to email on a document until it has moved to a certain point in the workflow that I’ve made.


I’m imagining the way to approach this is remove options from the menu using something like:

frappe.ui.form.on('docType', {
	onload(frm) {
    if(frm.doc.doc_status ___is in___list_of_statuses){
        cur_frm.page.remove_inner_button(__('Email'),  __('...'));

Any ideas? I have a feeling that the 3-dots button might not be targetable by page.remove_inner_button.


Hi @Andy_Jones,

So you can apply a client/custom script for that.
Please apply and check it.

frappe.ui.form.on('Your DocType', {
	refresh(frm) {
	    if(frm.doc.docstatus != 1){

Please set your workflow condition according to.

Thank You!

1 Like

That worked perfectly. Thank you.