简体   繁体   中英

vTiger: “Permission to perform the operation is denied for name”

I found some cases where the error was the same, but the situation was not.

This is intended as custom workflow function in vTiger, code is the following:

function perform_query($entity) {
    /*$entityArray = get_object_vars($entity); //array
    echo "<pre>";
    print_r($entityArray);
    echo "</pre>";
    break;*/
    include_once 'include/Webservices/Query.php';
    include_once 'modules/Users/Users.php';

    $user = new Users();
    $current_user = $user->retrieveCurrentUserInfoFromFile(Users::getActiveAdminId());
    try {
    $q = "SELECT * FROM vtiger_seactivityrel WHERE crmid = ".substr($entity->id, strpos($entity->id, "x") + 1);
    $q = $q . ';';
    $records = vtws_query($q, $current_user);
    print_r($records);
    } catch (WebServiceException $ex) {
        echo $ex->getMessage();
    }
    break;
}
?>

This should give me the results: if there are, i want to take further actions. This gives me the following error:

Permission to perform the operation is denied for name .

I don't know what's happening, does anyone have any idea? Thank you.

I solved this myself. The fact is that vtws_query does NOT query the database directly. It has some kind of abstraction, so if you put database table and columns it just denies access. Although strange, right form is this one:

SELECT * FROM <ModuleName> WHERE <Property> = '<your_search>'

To list the modules, you should use vtws_listtypes ; to know which properties you could search, use vtws_describe . More info here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM