AnsweredAssumed Answered

Conditionally hiding the edit button on Leads detail view based on field value is not working as expected

Question asked by Tien Tran on Mar 6, 2014
Latest reply on Oct 2, 2014 by Harald Kuske
I modify in custom/module/Leads/views/view.detail.php

My code :


$GLOBALS['listbutton'] = $this-&gt;dv-&gt;defs['templateMeta']['form']['buttons'];        <br>    if ($this-&gt;bean-&gt;status == 'Converted') {
         unset($this-&gt;dv-&gt;defs['templateMeta']['form']['buttons'][0]);
     }
     parent::display();

     $GLOBALS['log']-&gt;debug("INFOdation log Display");       
     $this-&gt;dv-&gt;defs['templateMeta']['form']['buttons'] = $GLOBALS['listbutton'];
But when status =='New' , the edit button still hide. Could you help me. I only want edit button hide when status == 'Converted', other status it has to apperance.


Outcomes