本文介绍了vTiger 网络服务“ACCESS_DENIED : id 拒绝执行操作的权限"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 vTiger 网络服务添加 SalesOrder.我正在使用这个 vtwsclib.代码如下:

I want to add SalesOrder through vTiger webservice. I'm using for this vtwsclib. Here is the code:

<?php
include_once('vtwsclib/Vtiger/WSClient.php');
$url = 'http://localhost:8888';
$client = new Vtiger_WSClient($url);
$login = $client->doLogin('admin', 'zzzzzzzz');
if(!$login) echo 'Login Failed';
else {

    $data = array(
        'subject' => 'Test SalesOrder',
        'sostatus' => 'Created',
        'invoicestatus'=>'AutoCreated',
        'account_id'=> '46', // Existing account id
        'bill_street' => 'Bill Street',
        'ship_street' => 'Ship Street',
    );
    $record = $client->doCreate('SalesOrder', $data);

$error = $client->lasterror();
    if($error) {
    echo $error['code'] . ' : ' . $error['message'];
}

if($record) {
    $salesorderid = $client->getRecordId($record['id']);
}

}
?>

我只得到:ACCESS_DENIED:id 拒绝执行操作的权限".

And I get only: "ACCESS_DENIED : Permission to perform the operation is denied for id".

Account_id 存在于数据库中.其他 SalesOrder 使用相同的 account_id 添加,但通过网页添加.我还尝试了带有 accout_id = "6x46" 的变体,其中 6 是 module_id.它也没有奏效.任何想法如何解决这个问题?

Account_id exists in database. Other SalesOrder was added with the same account_id but through webpage. I have also tried variant with accout_id = "6x46" where 6 is module_id. It also didn't work. Any ideas how to solve this problem?

推荐答案

我认为您应该尝试使用 11x46 作为帐户 ID.Vtiger Web 服务实体 ID 与 tabid 不同.

I think you should be trying 11x46 for account id. Vtiger web services entity id's are different from tabids.

要获得所有实体 ID 的正确列表,请在您的 MySQL 中为 CRM 执行此操作:

To get a correct list of all entity ids, execute this in your MySQL for the CRM:

select id, name from vtiger_ws_entity;

这篇关于vTiger 网络服务“ACCESS_DENIED : id 拒绝执行操作的权限"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 21:16