Remove options on the button actions items

Hi Guy,

I try to remove actions items on Accounts list view adding the following code on custom/modules/Accounts/views:

class CustomAccountsViewList extends AccountsViewList{

    public function preDisplay(){
        parent::preDisplay();
		$this->lv->export = false;  //remove EXPORT
        $this->lv->targetlist = false;	//remove TARGET LIST
        
    }

After quick repair this code has no effect. Any idea?
Thanks

Hi, I find that some fields name are sligth different : $targetList instead of $targetlist work fine.

I find this mistake looking at structure with this code:

echo '<pre>'; var_dump($this->lv); echo '</pre>'; die;

However, I cannot find any fields for the attached entry.

Any help?

… the action is “Add Contacts To Target List” . I try to attach a picture but the add file button does’t work …

Here is free plugin to clean/hide anything from interface.

It works on both Ajax and Not ajax UI.

https://store.outrightcrm.com/product/suitecrm-global-hide-manager/

Update this cause I have the same issue. want to hide “Add Contacts To Target List” but there is no option in $this->lv.

What does the var_dump($this->lv); give?

Will dont c/c the all thing cause its huge but the part that interest us :

As you can see I’ve put delete & targetlist to false already. But I still have this Add Contacts To Target Lis to hide and no option to do it …

Try to unset that member, instead of making it false.

But my previous question would be: was it there before? Are you changing in the right place?

Unset it like this ?

unset($this->dv->defs[‘templateMeta’][‘form’][‘buttons’][0])

Tried in the custom vie.list.php of my module but it dont work.

$this->lv->delete = false;

Work so that why I used the boolean.

Everything is coming from include/ListView/ListViewSmarty.php so im digging in this file to find the name of the action button

$this->lv->delete = 0;

This remove the button #delete_listview