Created
December 26, 2017 11:25
-
-
Save musdevs/c20537e0832ea38423f33409ced08a64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\Bitrix\Main\Loader::includeModule('crm'); | |
$companyId = 0; | |
$contactId = 0; | |
$arFields['COMPANY_BINDINGS'] = Bitrix\Crm\Binding\EntityBinding::prepareEntityBindings( | |
\CCrmOwnerType::Company, | |
[$companyId] | |
); | |
$contact = new \CCrmContact; | |
$contact->Update($contactId, $arFields); | |
if (!$contact->LAST_ERRORS) { | |
echo "Contact linked successfully\n"; | |
} else { | |
echo "Error: " . $contact->LAST_ERRORS . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment