Hi,
I need to customize the accounts pop.view.php so that if role = “my role” the displayed records are searched only with particular where conditions.
I created an override in custom> modules> accounts> views
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
global $current_user;
include_once(‘modules/ACLRoles/ACLRole.php’);
class CustomAccountsViewPopup extends ViewPopup{
public function listViewProcess(){
parent::listViewProcess();
$roles = getUserRoleNames($current_user->id);
If ($roles=="my role"){
..........................................
}
}
function CustomAccountsViewPopup(){
parent::ViewPopup();
}
function preDisplay(){
parent::preDisplay();
}
}
but now I don’t know how to limit the query and fish only among some records.
Hi anche thanks but I am seeing that it is very difficult to get what I need.
Instead, another way could be to convert a select extracted from accounts to a dropdown list in my custom module edit view
Does this look simpler according to your experience?
You would make it a Relate field, and then have to customize the way it searches, in code. Look for answers here mentioning “sqs” which is the name of the find-as-you-type search feature in dropdowns.