remove buttom from sugarcrm module detail view

create a file “view.detail.php” at custom\modules\<MODULE NAME>\

add code:

require_once(‘include/MVC/View/views/view.detail.php’);

class <MODULE NAME>ViewDetail extends ViewDetail {

function <MODULE NAME>ViewDetail(){
parent::ViewDetail();
}

function display() {

$button = “<BUTTON NAME>”;

if(in_array($button , $this->dv->defs['templateMeta']['form']['buttons'])) {

foreach($this->dv->defs['templateMeta']['form']['buttons'] as $key => $value) {

if ($value == $button ) unset($this->dv->defs['templateMeta']['form']['buttons'][$key]);
}
}

parent::display();
}
}

then clear cache and repair.

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.