# Advanced query You can modify the query executed to load the data in ListView, RelatedList and Popup mode in order to limit or extend the visibility of the data. This does not affect Administrator users, who have access to all data. In addition, the module must be set as Private. Editing the query is done through a custom php function (see below). Only one function of this type can be used in each module. To register the function use: ```PHP SDK::setAdvancedQuery($module, $func, $src); ``` *$module : the module in which to apply the function (if a function is already registered for the module, the new one is not inserted)* *$func : the name of the php function* *$src : the php file that contains the function* To remove the customization: ```PHP SDK::unsetAdvancedQuery($module); ``` *$module : the name of the module* The $func function must be defined as follows: ```PHP **Hooks** data/CRMEntity.php