Removing an item in list view to Contracts module

Hi,

I would do like to remove the “duplicate” item ViewList to Contracts module.

I tried this:

  1. File created in:
    custom/modules/AOS_Contracts/views/view.list.php

  2. Content:

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

require_once 'include/MVC/View/views/view.list.php';

class CustomContractsViewList extends ViewList
{
    public function preDisplay()
    {
        parent::preDisplay();

        # Hide Quick Edit Pencil
        $this->lv->quickViewLinks = false;
    }
}
  1. Admin / rebuild

But, does not work.

if you want to hide the Duplicate option in Detailview you need to copy this file

to

the metadata folder probably wont be there, just create it

then in the copied file edit this line

array (
        'buttons' =>
        array (
          0 => 'EDIT',
          1 => 'DUPLICATE',
          2 => 'DELETE',
          3 => 'FIND_DUPLICATES',
          4 =>
          array (
            'customCode' => '<input type="button" class="button" onClick="showPopup(\'pdf\');" value="{$MOD.LBL_PRINT_AS_PDF}">',
          ),
          5 =>
          array (
            'customCode' => '<input type="button" class="button" onClick="showPopup(\'emailpdf\');" value="{$MOD.LBL_EMAIL_PDF}">',
          ),
        ),
      ),

to

array (
        'buttons' =>
        array (
          0 => 'EDIT',
          //1 => 'DUPLICATE',
          2 => 'DELETE',
          3 => 'FIND_DUPLICATES',
          4 =>
          array (
            'customCode' => '<input type="button" class="button" onClick="showPopup(\'pdf\');" value="{$MOD.LBL_PRINT_AS_PDF}">',
          ),
          5 =>
          array (
            'customCode' => '<input type="button" class="button" onClick="showPopup(\'emailpdf\');" value="{$MOD.LBL_EMAIL_PDF}">',
          ),
        ),
      ),

then quick build & repair

best regards