diff --git a/application/Espo/Core/Formula/AttributeFetcher.php b/application/Espo/Core/Formula/AttributeFetcher.php index 711ba7d4c3..db0158ff2f 100644 --- a/application/Espo/Core/Formula/AttributeFetcher.php +++ b/application/Espo/Core/Formula/AttributeFetcher.php @@ -70,6 +70,11 @@ class AttributeFetcher if ($parent = $entity->get($relationName)) { return $parent->get('name'); } + } else if ($entity->getAttributeParam($attribute, 'isLinkMultipleIdList') && $methodName == 'get') { + $relationName = $entity->getAttributeParam($attribute, 'relation'); + if (!$entity->has($attribute)) { + $entity->loadLinkMultipleField($relationName); + } } return $entity->$methodName($attribute); diff --git a/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php b/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php index 824d38471b..0e015c7c9d 100644 --- a/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php +++ b/application/Espo/Core/Utils/Database/Orm/Fields/LinkMultiple.php @@ -39,6 +39,8 @@ class LinkMultiple extends Base $fieldName.'Ids' => array( 'type' => 'varchar', 'notStorable' => true, + 'isLinkMultipleIdList' => true, + 'relation' => $fieldName ), $fieldName.'Names' => array( 'type' => 'varchar',