Let your module name is “company”, table name is “company” and subpanel is ["Company"]["subpanel_setup"]["sales"];
Create a new file “custom.php” at in/custom/Extension/modules/Company/Ext/Layoutdefs/
Write/follow below code as you need:
<?php
global $bean,$db; $id = $_GET["record"];
$query_cstm=”SELECT * FROM company WHERE id=’$id’”;
$result_cstm=$db–>query($query_cstm,true);
$row_cstm=$db->fetchByAssoc($result_cstm);
$city= $row_cstm["city"];if($city != ‘dhaka’){
unset($layout_defs["Company"]["subpanel_setup"]["sales"]);
}?>
And then just repair Extension from admin.
Posted by lifos