I have problem with transforming "Lead" into "Account". When i directly add new "Account", there is error 409 and copy is not added, everything is ok. The problem is when i want to transform "Lead" into "Account" ("Account" card already exist), there is no error 409 and "Lead" is transforming into "Account". Is there any solution for this?
I have problem with transforming "Lead" into "Account".
Collapse
X
-
Hi
try to override method convert in Lead Service (create in /custom/Espo/Custom/Services a file Lead.php)
Code:namespace Espo\Custom\Services; class Lead extends Espo\Modules\Crm\Services\Lead {
instead of
Code:$account = $entityManager->getEntity('Account'); $account->set(get_object_vars($recordsData->Account)); $entityManager->saveEntity($account); $lead->set('createdAccountId', $account->id);
Code:$account = $this->getRecordService('Account')->createEntity(get_object_vars($recordsData->Account)); $lead->set('createdAccountId', $account->id);
Comment