Forums › Forums › OroCRM › OroCRM – How do I? Questions › Multiple contacts for B2B Customers
This topic contains 11 replies, has 7 voices, and was last updated by vfox1136 4 years, 11 months ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- May 9, 2015 at 8:19 am #28416
Hi
Currently you can define only one contact for B2B customers. I know you can have multiple contacts for its related account. But sometimes you need to have multiple contacts for only one B2B customer. Why have you restricted the number of directly connected accounts of B2B Customers to one? Any special reason?
Thanks
- CreatorTopic
- AuthorReplies
- May 26, 2015 at 8:06 am #28417
Hi Ahmad,
There is no particular reason for such a limit, guess we just overlooked it. Thanks for the correction, we will fix this in the upcoming release.
May 26, 2015 at 10:15 pm #28418Excellent. Thanks.
November 12, 2015 at 5:13 am #28419What is the status on this?
November 12, 2015 at 1:57 pm #28420Still in our backlog I’m afraid. We had to reconsider our priorities and moved this issue down the line.
I will try to get it back to the priorities list and will post an update here as soon as anything is clearly decided.
Thank you for your patience.
November 17, 2015 at 5:06 am #28421Ok, thanks!
June 25, 2018 at 1:04 pm #28422Did anything change on this? As of 2.5 this is not available but we more and more see use cases for this feature. For example, bigger companies often have multiple contacts involved in project decision making on department level (which we treat as b2b customers). We could actually assign them to the same account but in big company structures not all contacts necessarily belong to the same ‘customer’, often not even to the same field of business.
We’re currently implementing marketing Tools but can’t propperly segment because of this limitation. With the currently data structure, a lot of contacts would be missed in mailing campaigns because the company relation and therefore industry and other relevant b2b customer data is not available.
As far as we can see from the entity class files this should be quite easy to implement by changing the b2b(n) <->(1)contact relationship to a m-n one?
This feature is a must have in b2b crm and we would really appreciate to see this in a upcoming release.
Best Regards
MartinJune 27, 2018 at 1:56 am #28423Hi Martin,
Thank you for your suggestions. We agree that this use case is valid and important but unfortunately our current development priorities will not allow us to release this feature in the upcoming 3.0 LTS release.
July 3, 2018 at 1:46 am #28424Hi Artem,
thanks for your reply!
Glad to hear, that it’s at least still in the backlog.We tried to implement a workaround by extending the b2bcustomer entity within the gui, adding a many-to-many field. Our Concept is to use the entities ‘contact’ field for the primary contact at a specific b2bcustmer and thus having other related contact in the extended field.
This works in terms of creating the field and relations as well as the gui items.
We flushed and warmed the cache and did a entitiy extend cache flush.However, after doing this, its not possible to create or modify email notifications for the b2bcustomer entitiy anymore. The following exception is thrown:
Field “Oro\Bundle\ContactBundle\Entity\Contact::b2bcustomer_b2bcustomercontacts” is not configurable
500 Internal Server Error – RuntimeExceptionPHP123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960[1] Oro\Bundle\EntityConfigBundle\Exception\RuntimeException: Field "Oro\Bundle\ContactBundle\Entity\Contact::b2bcustomer_b2bcustomercontacts" is not configurableat n/ain /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/EntityConfigBundle/Config/ConfigManager.php line 320at Oro\Bundle\EntityConfigBundle\Config\ConfigManager->getFieldConfig('entity', 'Oro\Bundle\ContactBundle\Entity\Contact', 'b2bcustomer_b2bcustomercontacts')in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/EntityConfigBundle/Provider/ConfigProvider.php line 129at Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider->getConfig('Oro\Bundle\ContactBundle\Entity\Contact', 'b2bcustomer_b2bcustomercontacts')in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Form/EventListener/AdditionalEmailsSubscriber.php line 184at Oro\Bundle\NotificationBundle\Form\EventListener\AdditionalEmailsSubscriber->getFieldLabel('Oro\Bundle\ContactBundle\Entity\Contact', 'b2bcustomer_b2bcustomercontacts')in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Form/EventListener/AdditionalEmailsSubscriber.php line 135at Oro\Bundle\NotificationBundle\Form\EventListener\AdditionalEmailsSubscriber->collectEmailFieldsRecursive('Oro\Bundle\ContactBundle\Entity\Contact', array('account' => 'Benutzer', 'account.owner' => 'Benutzer > Besitzer', 'account.contacts' => 'Benutzer > Kontakte', 'account.defaultContact' => 'Benutzer > Standard Kontakt', 'account.referredBy' => 'Benutzer > Empfehlung von', 'contact' => 'Kontakt', 'contact.owner' => 'Kontakt > Besitzer', 'contact.assignedTo' => 'Kontakt > Zugewiesen', 'contact.reportsTo' => 'Kontakt > Rückmeldung an', 'contact.accounts' => 'Kontakt > Konten', 'contact.createdBy' => 'Kontakt > Erstellt von', 'contact.updatedBy' => 'Kontakt > Aktualisiert von', 'contact.defaultInAccounts' => 'Kontakt > Standard-Kontakt von Account'), array('contact'), array('Kontakt'))in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Form/EventListener/AdditionalEmailsSubscriber.php line 150at Oro\Bundle\NotificationBundle\Form\EventListener\AdditionalEmailsSubscriber->collectEmailFieldsRecursive('Oro\Bundle\SalesBundle\Entity\B2bCustomer', array('account' => 'Benutzer', 'account.owner' => 'Benutzer > Besitzer', 'account.contacts' => 'Benutzer > Kontakte', 'account.defaultContact' => 'Benutzer > Standard Kontakt', 'account.referredBy' => 'Benutzer > Empfehlung von', 'contact' => 'Kontakt', 'contact.owner' => 'Kontakt > Besitzer', 'contact.assignedTo' => 'Kontakt > Zugewiesen', 'contact.reportsTo' => 'Kontakt > Rückmeldung an', 'contact.accounts' => 'Kontakt > Konten', 'contact.createdBy' => 'Kontakt > Erstellt von', 'contact.updatedBy' => 'Kontakt > Aktualisiert von', 'contact.defaultInAccounts' => 'Kontakt > Standard-Kontakt von Account'))in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Form/EventListener/AdditionalEmailsSubscriber.php line 110at Oro\Bundle\NotificationBundle\Form\EventListener\AdditionalEmailsSubscriber->initAdditionalRecipientChoices('Oro\Bundle\SalesBundle\Entity\B2bCustomer', object(Form))in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Form/EventListener/AdditionalEmailsSubscriber.php line 99at Oro\Bundle\NotificationBundle\Form\EventListener\AdditionalEmailsSubscriber->preSubmit(object(FormEvent), 'form.pre_bind', object(EventDispatcher))in lineat call_user_func(array(object(AdditionalEmailsSubscriber), 'preSubmit'), object(FormEvent), 'form.pre_bind', object(EventDispatcher))in /var/www/orocrm/html/app/cache/dev/classes.php line 2238at Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(array(array(object(BindRequestListener), 'preBind'), array(object(TrimListener), 'preSubmit'), array(object(CsrfValidationListener), 'preSubmit'), array(object(BuildTemplateFormSubscriber), 'preSubmit'), array(object(AdditionalEmailsSubscriber), 'preSubmit'), array(object(EmailNotificationTypeListener), 'onPreSubmit')), 'form.pre_bind', object(FormEvent))in /var/www/orocrm/html/app/cache/dev/classes.php line 2153at Symfony\Component\EventDispatcher\EventDispatcher->dispatch('form.pre_bind', object(FormEvent))in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php line 43at Symfony\Component\EventDispatcher\ImmutableEventDispatcher->dispatch('form.pre_bind', object(FormEvent))in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php line 546at Symfony\Component\Form\Form->submit(object(Request))in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Controller/EmailNotificationController.php line 90at Oro\Bundle\NotificationBundle\Controller\EmailNotificationController->update(object(EmailNotification), object(Request))in /var/www/orocrm/html/vendor/oro/platform/src/Oro/Bundle/NotificationBundle/Controller/EmailNotificationController.php line 77at Oro\Bundle\NotificationBundle\Controller\EmailNotificationController->createAction(object(Request))in lineat call_user_func_array(array(object(EmailNotificationController), 'createAction'), array(object(Request)))in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 144at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 64at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 69at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)in /var/www/orocrm/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 185at Symfony\Component\HttpKernel\Kernel->handle(object(Request))in /var/www/orocrm/html/web/app_dev.php line 34However, doctrine shows no entity errors in symfony profiler..
Is this a bug or did we do it wrong?
Kind Regards
MartinConfig in Gui for reference:
July 12, 2018 at 7:47 am #28425Hi Martin,
Just reproduced the issue. This is definitely a bug, the problem that bi-directional field doesn’t work as expected from the Contact side when relation created from UI.
As a workaround, you can create this relation using migration, this should work, something like
PHP123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354<?phpnamespace AcmeDemoBundle\Migrations\Schema\v1_1;use Doctrine\DBAL\Schema\Schema;use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension;use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtensionAwareInterface;use Oro\Bundle\MigrationBundle\Migration\Migration;use Oro\Bundle\MigrationBundle\Migration\QueryBag;use Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendScope;class AddB2bCustomerToContactRelation implements Migration, ExtendExtensionAwareInterface{/*** @var ExtendExtension*/protected $extendExtension;/*** @inheritdoc*/public function setExtendExtension(ExtendExtension $extendExtension){$this->extendExtension = $extendExtension;}/*** {@inheritdoc}*/public function up(Schema $schema, QueryBag $queries){$this->extendExtension->addManyToManyRelation($schema,'orocrm_sales_b2bcustomer', // owning side table'contacts', // owning side field name'orocrm_contact', // inverse side table['first_name', 'last_name'], // column names are used to show a title of related entity['name_prefix', 'first_name', 'last_name'], // column names are used to show detailed info about related entity['first_name', 'last_name'], // Column names are used to show related entity in a grid['extend' => ['owner' => ExtendScope::OWNER_CUSTOM]]);$this->extendExtension->addManyToManyInverseRelation($schema,'orocrm_sales_b2bcustomer', // owning side table'contacts', // owning side field name'orocrm_contact', // inverse side table'customers', // inverse side field name['name'], // column names are used to show a title of owning side entity['name'], // column names are used to show detailed info about owning side entity['name'], // Column names are used to show owning side entity in a grid['extend' => ['owner' => ExtendScope::OWNER_CUSTOM]]);}}to apply migration, just run
php bin/console oro:migration:load --force
Best regards.
July 19, 2018 at 2:11 pm #28426Pity, it’s in backlog since three years so it will never come, I have also a similar need for one to many Customer to contacts. The idea behind is not have to enter for each contact the same address if he belongs to the same Customer
May 18, 2019 at 10:44 am #38887It’s a shame that this feature still seems not to be fixed. It would be a great help for those using OroCRM.
- AuthorReplies
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.