Announcement

Collapse
No announcement yet.

Export multiple phones and multiple e-mails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export multiple phones and multiple e-mails

    Hi,
    i would like to export all the phone numbers and e-mails from my accounts.
    I try the following but it's not working.


    <?php

    namespace Espo\Custom\Services;

    class Contact extends \Espo\Core\Templates\Services\Person
    {

    protected $exportAdditionalFieldList = ['phoneNumberOffice'];

    public function loadAdditionalFieldsForExport(\Espo\ORM\Entity $entity)
    {
    parent::loadAdditionalFieldsForExport($entity);
    $this->loadPhoneNumberField($entity);
    }

    protected function getFieldPhoneNumberOfficeFromEntityForExport(\Espo \ORM\Entity $entity)
    {
    $phoneNumberData = $entity->get('phoneNumberData');
    foreach ($phoneNumberData as $d) {
    if ($d->type == 'Office') {
    return $d->phoneNumber;
    }
    }
    return '';
    }

    }

    ?>

  • #2
    As far as I'm aware it is always difficult with these two field, there is another thread here (quite old though) that see to work for Phone but not email:
    Please consider adding the capability to import and export multiple email addresses and phone numbers for a single account, contact, and/or lead. For example,

    Comment


    • #3
      Originally posted by espcrm View Post
      As far as I'm aware it is always difficult with these two field, there is another thread here (quite old though) that see to work for Phone but not email:
      https://forum.espocrm.com/forum/feat...-phone-numbers
      From there i get the code but is not working.

      Comment

      Working...
      X