Hi,
I created a calculated field to SUM hours...
The field definition is as follows (tables and field names changed for better comprehension)..
"totalTime": {
"type": "int",
"readOnly": true,
"notStorable": true,
"view": "custom:views/fields/totalTime",
"select": {
"sql": "SUM(B.time)",
"leftJoins": [
[
"Table-A",
"A",
{
"A.id:": "id",
"A.deleted": false
}
],
[
"Table-B",
"B",
{
"B.id:": "A.id",
"B.deleted": false
}
]
]
}
},
* Now, when the field is displayed in a "DETAIL" view, all works as expected. The "id" on the right side of the first "leftJoin" is replaced with the entity id value, and the query is retrieving the correct value.
* But when the field is used in a "LIST" view, seems like the "id" field is not replaced for every occurrence in the list, and no values are retrieved --empty list--
Is there something I misunderstood ?
Any help or suggestion will be welcomed.
TIA
I created a calculated field to SUM hours...
The field definition is as follows (tables and field names changed for better comprehension)..
"totalTime": {
"type": "int",
"readOnly": true,
"notStorable": true,
"view": "custom:views/fields/totalTime",
"select": {
"sql": "SUM(B.time)",
"leftJoins": [
[
"Table-A",
"A",
{
"A.id:": "id",
"A.deleted": false
}
],
[
"Table-B",
"B",
{
"B.id:": "A.id",
"B.deleted": false
}
]
]
}
},
* Now, when the field is displayed in a "DETAIL" view, all works as expected. The "id" on the right side of the first "leftJoin" is replaced with the entity id value, and the query is retrieving the correct value.
* But when the field is used in a "LIST" view, seems like the "id" field is not replaced for every occurrence in the list, and no values are retrieved --empty list--
Is there something I misunderstood ?
Any help or suggestion will be welcomed.
TIA
Comment