I created a custom dashlet to shown all opportunities from that belongs to a customer, related to opportunities is in my case an entity called "Projekt". Because a lot of Opportunities belongs to a "Projekt". In the Entity "Projekt" I have an Image that I want to show in my custom daslet, but I don't know how to!
My Dashlet:
{
"view":"views/dashlets/abstract/record-list",
"aclScope": "Opportunity",
"entityType": "Opportunity",
"options": {
"fields": {
"title": {
"type": "varchar",
"required": true
},
"autorefreshInterval": {
"type": "enumFloat",
"options": [0, 0.5, 1, 2, 5, 10]
},
"displayRecords": {
"type": "enumInt",
"options": [3,4,5,10,15,20,30]
}
},
"defaults": {
"sortBy": "closeDate",
"asc": true,
"displayRecords": 5,
"expandedLayout": {
"rows": [
[
{
"name":"projekt.bild"
},
{
"name": "name",
"link": true
}
],
[
{
"name": "stage"
},
{
"name": "amount"
}
]
]
},
"searchData": {
"bool": {
"onlyMy": false
},
"primary": "all"
}
},
"layout": [
{
"rows": [
[
{"name": "title"}
],
[
{"name": "displayRecords"},
{"name": "autorefreshInterval"}
]
]
}
]
}
}
Tried to load the Image in the Custom Opportunity.php
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class Opportunity extends \Espo\Modules\Crm\Services\Opportunity
{
public function loadAdditionalFieldsForList(Entity $entity)
{
parent::loadAdditionalFieldsForList($entity);
$entity->loadLinkMultipleField('contacts');
$entity->loadLinkMultipleField('projekt','bild');
}
}
What did i missed?
My Dashlet:
{
"view":"views/dashlets/abstract/record-list",
"aclScope": "Opportunity",
"entityType": "Opportunity",
"options": {
"fields": {
"title": {
"type": "varchar",
"required": true
},
"autorefreshInterval": {
"type": "enumFloat",
"options": [0, 0.5, 1, 2, 5, 10]
},
"displayRecords": {
"type": "enumInt",
"options": [3,4,5,10,15,20,30]
}
},
"defaults": {
"sortBy": "closeDate",
"asc": true,
"displayRecords": 5,
"expandedLayout": {
"rows": [
[
{
"name":"projekt.bild"
},
{
"name": "name",
"link": true
}
],
[
{
"name": "stage"
},
{
"name": "amount"
}
]
]
},
"searchData": {
"bool": {
"onlyMy": false
},
"primary": "all"
}
},
"layout": [
{
"rows": [
[
{"name": "title"}
],
[
{"name": "displayRecords"},
{"name": "autorefreshInterval"}
]
]
}
]
}
}
Tried to load the Image in the Custom Opportunity.php
<?php
namespace Espo\Custom\Services;
use \Espo\ORM\Entity;
class Opportunity extends \Espo\Modules\Crm\Services\Opportunity
{
public function loadAdditionalFieldsForList(Entity $entity)
{
parent::loadAdditionalFieldsForList($entity);
$entity->loadLinkMultipleField('contacts');
$entity->loadLinkMultipleField('projekt','bild');
}
}
What did i missed?
Comment