Is there any way to hide connections when workflow state is approved

Screenshot 2024-02-07 202837
any ways to show this if the document is approved?

I only need to show this when document is approved until then it should hidden

You would want the entire connections tab to be hidden until approved or only the vehicle log option within Connections?

Hi @ESP_Luffy,

Please check the syntax.

frappe.ui.form.on('Your DocType', {
	refresh: function(frm) {
		if (frm.doc.docstatus == 1) {
			$('.row.form-dashboard-section.form-links').hide();
		}
	}
});

// OR 
// If you apply the workflow in doctype then apply it
frappe.ui.form.on('Your DocType', {
	refresh: function(frm) {
		if (frm.doc.workflow_state == "Approved") {
			$('.row.form-dashboard-section.form-links').hide();
		}
	}
});

Reference:

Please set the doctype and workflow state in the script according to the scenario.

I hope this helps.

Thank You!

1 Like

entire connection should be hidden until approved

thanks for the response!! will it defaulty hidden until the doc is approved

thanks it worked!!!