fix convert lead title

This commit is contained in:
Yurii
2026-01-22 18:13:40 +02:00
parent f5d8f515d5
commit ae853a7848
3 changed files with 16 additions and 0 deletions

View File

@@ -40,6 +40,9 @@ class Contact extends Person
{
public const ENTITY_TYPE = 'Contact';
/** @since v9.3.0. */
public const string COLUMN_ACCOUNTS_ROLE = 'role';
/**
* An assigned user.
*/

View File

@@ -197,4 +197,9 @@ class Lead extends Person
{
return $this->setRelatedLinkOrEntity('campaign', $campaign);
}
public function getTitle(): ?string
{
return $this->get('title');
}
}

View File

@@ -314,6 +314,14 @@ class ConvertService
if ($account) {
$values->accountId = $account->getId();
if ($lead->getTitle()) {
$values->accountsColumns = (object) [
$account->getId() => (object) [
Contact::COLUMN_ACCOUNTS_ROLE => $lead->getTitle(),
],
];
}
}
$service = $this->recordServiceContainer->getByClass(Contact::class);