How can I get an entity as available field in a list ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • antoine
    replied
    Hi Yuri, thanks for your help, I feel like an expert now for all the dummies, here is the how-to

    I added the following code in this file /www/crm/custom/Espo/Custom/Resources/layouts/XXX/list.json and the button YYY appears in Enabled column in list section of Layout manager for XXX entity

    Code:
        {
            "name": "YYY"
        },
    I stated this in /www/crm/custom/Espo/Custom/Services/XXX.php

    Code:
    <?php
    
    namespace Espo\Custom\Services;
    
    class Quote extends \Espo\Core\Templates\Services\Base
    {
    
        public function loadAdditionalFieldsForList(Entity $entity)
        {
            parent::loadAdditionalFieldsForList($entity);
            $entity->loadLinkMultipleField('YYY');
        }  
    }
    Several entities to link ?

    Code:
    <?php
    
    namespace Espo\Custom\Services;
    
    class Quote extends \Espo\Core\Templates\Services\Base
    {
    
        public function loadAdditionalFieldsForList(Entity $entity)
        {
            parent::loadAdditionalFieldsForList($entity);
            $entity->loadLinkMultipleField('YYY');
            $entity->loadLinkMultipleField('WWW');
            $entity->loadLinkMultipleField('ZZZ');
        }  
    }
    Last edited by antoine; 09-08-2016, 02:45 PM.

    Leave a comment:


  • yuri
    replied
    Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.

    Leave a comment:


  • antoine
    replied
    Hi Yuri,

    I didn't find a single lead on the whole internet, including Espo forum, that could help me understand what you said, so i could know which file to edit, and then what lines to add. Too bad there is no resources for absolute dummies. Nevermind, this issue was not that big. Thanks for your reply

    Leave a comment:


  • yuri
    replied
    Hi Antoine,

    You will need to load your field in Service class in loadAdditionalFields method.

    Leave a comment:


  • How can I get an entity as available field in a list ?

    Hi ! I have some difficulties to find an way to solve my issue, I hope someone will be able to guide me trough it
    1. I created an entity
    2. In Entity Manager section, I created a link with another entity. "Many-to-many" and both "Link multiple field" checked
    3. In Layout Manager, when I go the detail section of the entity I created, the other entity is present as an available field, and I can place it into the panel
    My issue is that I need the other entity to be also present in the list section of the created entity. Can anyone tell how this can be done ?

    Many thanks for your help

    Antoine

Working...