Not abe to export Other Types of Phone Number field data rather than primary

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agcool18
    Junior Member
    • Jan 2018
    • 5

    Not abe to export Other Types of Phone Number field data rather than primary

    I followed the guidelines for espo to add phone other types such as home or office data to also export along with the primary phone data. I created a service for my contact entity in custom/espo/custom/services/Contact.php

    Following is the code
    <?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 ''; } } ?>

    BUT IT IS NOT WORKING AND STILL IT IS EXPORTING ONLY PRIMARY PHONE VALUE NOT THE OFFICE TYPE ALONGWITH
Working...