如何使用php-crm-toolkit在Microsoft Dynamics Online CRM中创建案例或事件 [英] How To Create a case Or Incident In Microsoft Dynamics Online CRM using php-crm-toolkit
本文介绍了如何使用php-crm-toolkit在Microsoft Dynamics Online CRM中创建案例或事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建给我的情况
I am trying to create case it's giving me
致命错误:没想到的AlexaCRM\CRMToolkit\SoapFault:您应该指定父联系人或帐户。在D:ampwamp64\www\php_crm\vendor\alexacrm\php-crm-toolkit\src\Client.php行1159
"Fatal error: Uncaught AlexaCRM\CRMToolkit\SoapFault: You should specify a parent contact or account. in D:\wamp64\www\php_crm\vendor\alexacrm\php-crm-toolkit\src\Client.php on line 1159"
我的代码:
<?php
/**
* Use init.php if you didn't install the package via Composer
*/
require_once 'vendor/autoload.php';
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
$options = [
'serverUrl' => '**********************',
'username' => '****************',
'password' => '*************',
'authMode' => '***********************',
];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );
// create a new contact
$incident = $service->entity( 'incident' );
$incident->title = 'Test Created With Proxy';
$incident->description = 'This is a test incident';
$incidentId = $incident->create();
?>
推荐答案
最后,我通过使用以下代码创建了大小写:
Finally I created case by using following code:
<?php
/**
* Use init.php if you didn't install the package via Composer
*/
require_once 'vendor/autoload.php';
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
use AlexaCRM\CRMToolkit\Entity\EntityReference;
$options = [
'serverUrl' => '**************************',
'username' => '**********************',
'password' => '*****************',
'authMode' => 'OnlineFederation',
];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );
$contact = $service->entity( 'contact' );
$contact->firstname = 'John';
$contact->lastname = 'Doe';
$contact->emailaddress1 = 'john.doe@example.com';
$guid = $contact->create();
$incident = $service->entity('incident');
//echo '<pre>';print_r($incident);echo '</pre>';
$incident->title = 'Test Created With Proxy';
$incident->description = 'This is a test incident';
$incident->customerid = new EntityReference( 'contact', $guid );
//$incident->ID = $guid;//contactid responsiblecontactid primarycontactid
$incidentId = $incident->create();
?>
这篇关于如何使用php-crm-toolkit在Microsoft Dynamics Online CRM中创建案例或事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文