How to hide Connection Button

I want to know how to hide a connection button based on a condition written in js.

I have a doctype “Unit” which has 2 connections “Reservation” and “Proposal”. The unit doctype has also field called “project_type” of type : select with options (Private, Government). I want to hide the (Reservation) connection when project_type = “Government” and hides the (Proposal) connection when project_type = “Private”.

Hi @Nadeen,

As per my understanding,
Please apply custom/client script.

$("[data-doctype='Your DocType Name']").parent().hide();

Reference: Hide the Heading On connection Document - #5 by Mohammed_E_Al-Qershi

Please check it.

Thank You!