Hi, I want to calculate two records via the report (subtract) how to do it please?
Announcement
Collapse
No announcement yet.
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.
-
Originally posted by yuri View PostHi,
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 Photos
Comment
-
Originally posted by yuri View PostI 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.
Is there a way to use the currency? Because I count two fields that are currency.
- Likes 1
Comment
Comment