I'm using https://github.com/AlexaCRM/php-crm-toolkit to send data from a form to an entity in CRM.
With normal fields it's okay but when I want to add 'new_produit_demande' it's gives error because that field is assigned to another entity ('new_produituic') and ('contact')
Any suggestions?
This is some code and it's not working.
<?php
require 'autoload.php' ;
use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;
$options = [
'serverUrl' => 'https://xxxxx',
'username' => 'xxxx',
'password' => 'xxxx',
'authMode' => 'xxx',
];
$serviceSettings = new Settings( $options );
$service = new OrganizationService( $serviceSettings );
$guid = 'd5bac140-b68b-e911-80cc-005056aa3849';
$contact = $service->entity('contact');
$contact->firstname='product1';
$contact->new_produit_demande = new EntityReference('new_produituic',$guid);
$contactId = $contact->create();
The error:
Fatal error: Class 'EntityReference' not found in C:\xampp\htdocs\ccr\test.php on line 29
You have to include the below namespace: