Hi, I want to calculate two records via the report (subtract) how to do it please?
two records via the report (subtract)
Collapse
X
-
Hi,
You need to create a notStorable int or float field manually (in metadata entityDefs) and specify an expression.
custom/Espo/Custom/Resources/metadata/entityDefs/YourEntityType.json
Code:{ "fields": { "diffField": { "type": "float", "notStorable": true, "readOnly": true, "select": { "select": "SUB:(field1, field2)" } } } }
Clear cache.
Then use this field in a report.
You will be able to set a label for your new field at Administration > Label Manager.Last edited by yuri; 09-29-2021, 05:46 PM.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks. -
Hi,
You need to create a notStorable int or float field manually (in metadata entityDefs) and specify an expression.
custom/Espo/Custom/Resources/metadata/entityDefs/YourEntityType.json
Code:{ "fields": { "diffField": { "type": "float", "notStorable": true, "readOnly": true, "select": { "select": "SUB:(field1, field2)" } } } }
Clear cache.
Then use this field in a report.
You will be able to set a label for your new field at Administration > Label Manager.2 PhotosComment
-
I wonder why you have the same field in Group By and Columns. This seems wrong.
To test whether the expression works, add it to the list view layout. You should see the value on the list view.
And the "currency" type can't be used here.If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.Comment
-
Is there a way to use the currency? Because I count two fields that are currency.Comment
Comment