【问题标题】:Insert new contact插入新联系人
【发布时间】:2019-10-28 04:39:05
【问题描述】:

我正在使用https://github.com/AlexaCRM/php-crm-toolkit 将数据从表单发送到 CRM 中的实体 我想将实体“new_produituic”中的产品 ID 添加到“联系人”实体

<?php 
require 'autoload.php' ;
use AlexaCRM\CRMToolkit\Entity\EntityReference;
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
$options = [
'serverUrl' => 'https://xxxx/',
              'username' => 'xxx',
              'password' => 'xxx',
              'authMode' => 'xxx',
              'ignoreSslErrors' => true

];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings ); 
$guid="00f1b74b-645c-e911-80c1-005056aa3849" ;   
$contact = $service->entity('contact');
 $contact->firstname='testproduits';
 $contact->new_produit_demande= new EntityReference('new_produituic',$guid);
 $contactId = $contact->create();

我希望添加一个联系人,字段名是“testproduits”,字段“new_produit_demande”是 guid

【问题讨论】:

  • 您看到任何错误?
  • 这是错误:致命错误:未捕获的异常 'AlexaCRM\CRMToolkit\SoapFault' 带有消息'主要用户(Id=0fdb9f17-4c5c-e911-80c1-005056aa3849,type=8)丢失 prvAppendTonew_produituic C:\xampp\htdocs\uic\alexacrm\php-crm-toolkit\src\Client.php:1159 中的权限 (Id=9f11bbd6-dcab-4764-9dbc-86fa5657f02a)' 堆栈跟踪:#0 C:\xampp\ htdocs\uic\alexacrm\php-crm-toolkit\src\Client.php(2011): AlexaCRM\CRMToolkit\Client->getSoapResponse('mycrm.u...', '

标签: php dynamics-crm crm alexacrm-toolkit


【解决方案1】:

这是权限/特权问题。错误提示 'Principal user (Id=0fdb9f17-4c5c-e911-80c1-005056aa3849, type=8) is missing prvAppendTonew_produituic privilege (Id=9f11bbd6-dcab-4764-9dbc-86fa5657f02a)' 这意味着您正在使用的用户 'username' =&gt; 'xxx', 所有安全角色都缺少 AppendTonew_produituic 实体的权限。

要完成以下步骤 - 您应该具有系统管理员/定制员角色。

转到该用户的任何安全角色,这是一个巨大的矩阵,单击Custom entities 选项卡,查找new_produituicEntity 行和AppendTo 列,如果您继续单击小圆圈,您可以提供根据您的需要,像半橙色(相同 BU)的完整绿色圆圈(整个组织)这样的特权。

Read more

【讨论】:

  • @AbdoMErzouk 很高兴为您提供帮助,请将其标记为答案以帮助他人
猜你喜欢
  • 2014-12-28
  • 1970-01-01
  • 1970-01-01
  • 2012-10-14
  • 1970-01-01
  • 2021-08-10
  • 2017-05-27
  • 1970-01-01
  • 2014-06-24
相关资源
最近更新 更多