I am working from this page about calculated fields in the documentation.
I have defined a custom field in a custom entity as follows:
In the documentation, it provides guidance about adding a "select" property that uses a Complex Expression to return the value. Complex Expressions convert into SQL select queries.
I need to return a value that is extracted from another related (not linked) entity. The value to return for this calculated field is generated from the value of a DB field. So a SELECT with JOIN will not provide the required value.
My Question:
Is there a way to declare/use a Custom Class instead of a Complex Expression that returns the value for a field? I need access to the full Entity record to reference the related Entity record.
I have defined a custom field in a custom entity as follows:
PHP Code:
{
"fields": {
"myCustomField": {
"type": "text",
"required": false,
"notStorable": true,
"utility": true,
"readOnly": true,
"customizationDisabled": true
}
}
}
I need to return a value that is extracted from another related (not linked) entity. The value to return for this calculated field is generated from the value of a DB field. So a SELECT with JOIN will not provide the required value.
My Question:
Is there a way to declare/use a Custom Class instead of a Complex Expression that returns the value for a field? I need access to the full Entity record to reference the related Entity record.
Comment