I'm trying to load a linkMultiple field in a list view using the instructions I found on the forum, but it isn't working.
Here are the threads I found that explain how to do this:
Here's what I've tried:
In custom/Espo/Custom/Services/Project.php:
In custom/Espo/Custom/Resources/layouts/Project/list.json:
The column appears in the list view, but I get a Bad Server Response error and this appears in the log:
What am I doing wrong?
Here are the threads I found that explain how to do this:
- How can I get an entity as available field in a list?
- Upddate a Listview including a LinkMulti Field
- Email: Customize Layout / Set Default Account
Here's what I've tried:
In custom/Espo/Custom/Services/Project.php:
PHP Code:
1 <?php
2
3 namespace Espo\Custom\Services;
4
5 class Project extends \Espo\Core\Templates\Services\BasePlus
6 {
7 public function loadAdditionalFieldsForList(Entity $entity)
8 {
9 parent::loadAdditionalFieldsForList($entity);
10 $entity->loadLinkMultipleField('accounts');
11 }
12 }
Code:
6 { 7 "name": "accounts" 8 },
Code:
[2018-03-19 11:22:30] Espo.WARNING: E_WARNING: Declaration of Espo\Custom\Services\Project::loadAdditionalFieldsForList(Espo\Custom\Services\Entity $entity) should be compatible with Espo\Services\Record::loadAdditionalFieldsForList(Espo\ORM\Entity $entity) {"code":2,"message":"Declaration of Espo\\Custom\\Services\\Project::loadAdditionalFieldsForList(Espo\\Custom\\Services\\Entity $entity) should be compatible with Espo\\Services\\Record::loadAdditionalFieldsForList(Espo\\ORM\\Entity $entity)","file":"/var/www/crm/custom/Espo/Custom/Services/Project.php","line":5,"context":{"file":"/var/www/crm/custom/Espo/Custom/Services/Project.php"}} [] [2018-03-19 11:22:30] Espo.ERROR: Uncaught Exception TypeError: "Argument 1 passed to Espo\Custom\Services\Project::loadAdditionalFieldsForList() must be an instance of Espo\Custom\Services\Entity, instance of Espo\Custom\Entities\Project given, called in /var/www/crm/application/Espo/Services/Record.php on line 837" at /var/www/crm/custom/Espo/Custom/Services/Project.php line 7 {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Espo\\Custom\\Services\\Project::loadAdditionalFieldsForList() must be an instance of Espo\\Custom\\Services\\Entity, instance of Espo\\Custom\\Entities\\Project given, called in /var/www/crm/application/Espo/Services/Record.php on line 837 at /var/www/crm/custom/Espo/Custom/Services/Project.php:7)"} []
Comment