{"title":"CalcFormula Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-calcformula-property/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-calcformula-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-calcformula-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets the Calculation formula for a FlowField.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":952,"chars":27},{"level":2,"title":"Syntax","slug":"syntax","at":979,"chars":59},{"level":2,"title":"Remarks","slug":"remarks","at":1038,"chars":976},{"level":2,"title":"Related information","slug":"related-information","at":2014,"chars":111}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets the Calculation formula for a FlowField.\nThe following syntax is valid for the CalcFormula property:\n```\nCalcFormula =\n[-]Exist(<DestinationTable> [WHERE (<TableFilters>)]) |\nCount(<DestinationTable> [WHERE (<TableFilters>)]) |\n[-]Sum(<DestinationTable>.<DestinationFieldName> [WHERE(<TableFilters>)])|\n[-]Average(<DestinationTable>.<DestinationFieldName> [WHERE(<TableFilters>)]) |\nMin(<DestinationTable>.<DestinationFieldName> [WHERE(<TableFilters>)]) |\nMax(<DestinationTable>.<DestinationFieldName> [WHERE(<TableFilters>)]) |\nLookup(<DestinationTable>.<DestinationFieldName> [WHERE(<TableFilters>)])\n<TableFilters> ::= <TableFilter> {,<TableFilter>}\n<TableFilter> ::=\n<DestinationFieldName> = CONST(<FieldConst>) | FILTER(<Filter>) | FIELD(<SourceFieldName>) | FIELD(UPPERLIMIT(<SourceFieldName>)) |\nFIELD(FILTER(<SourceFieldName>)) | FIELD(UPPERLIMIT(FILTER(<SourceFieldName>)))\n```\n## Applies to\n Table field\n## Syntax\n```al\nCalcFormula = Count(RecordCalcFields);\n```\n## Remarks\nParts of the formula are described in the following table.\nSymbol|Description\n`<DestinationTable>`|Specifies the destination table holding the information to be used in the FlowField.\n`<DestinationFieldName>`|Specifies the destination field name.\n`<TableFilters>`|A list of filters to be used in the computation of the FlowField.\n`<TableFilter>`|A table filter can be one of the following: a constant expression, a filter expression, a value from ordinary fields, or a FlowFilter field. A key for the other table must exist and include the fields used in the filters.\n`<SourceFieldName>`|Specifies the source field name.\n`<Filter>`|A filter expression such as 10|20..30.\nYou can choose from several methods of calculations including sum (total), average, maximum value, minimum value, record count, lookup, and whether a record exists. See ../devenv-creating-flowfields-and-flowfilters, FlowFields overview<../devenv-flowfields>, and ../devenv-flowfilter-overview.\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}