{"title":"DataItemTableFilter Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-dataitemtablefilter-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-dataitemtablefilter-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-dataitemtablefilter-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 filters on fields of the underlying table of a query.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":119,"chars":31},{"level":2,"title":"Property Value","slug":"property-value","at":150,"chars":136},{"level":2,"title":"Syntax","slug":"syntax","at":286,"chars":94},{"level":2,"title":"Remarks","slug":"remarks","at":380,"chars":1689},{"level":2,"title":"Example","slug":"example","at":2069,"chars":851},{"level":2,"title":"Related information","slug":"related-information","at":2920,"chars":151}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets filters on fields of the underlying table of a query.\n## Applies to\n Query Data Item\n## Property Value\nFilter expression.\nThe filter expression must follow the required syntax. See ../devenv-entering-criteria-in-filters.\n## Syntax\n```al\nDataItemTableFilter = \"Document Type\" = filter (Invoice | \"Credit Memo\");\n```\n## Remarks\nIn a query, a DataItem specifies a table from which to retrieve data. You use the DataItemTableFilter property to apply conditions on one or more fields of the table to limit the records in the resulting dataset of the query. You can filter on any field in the table, not just those fields that are included as columns in the resulting dataset.\nIn addition to the DataItemTableFilter property, you can also filter on the same field by setting the devenv-columnfilter-property on a column or filter row or by calling the SetFilter Method (Query)<../methods-auto/library> and SetRange Method (Query\\)<../methods-auto/library> from AL. A filter that is set by the ColumnFilter property, SetFilter method, or SetRange method is joined to the filter that is set by the DataItemTableFilter property. In logical terms, and in SQL SELECT statements, this combination corresponds to an \"AND\" operator. For example, if the DataItemTableFilter property sets a filter on a field to include values less than fifty \\(\\<50\\) and the ColumnFilter property sets a filter on the same field to include values greater than twenty \\(>20\\), then the resultant filter includes values that are greater than twenty and less than fifty \\(20\\< value \\<50\\). Using the same example, if the SetFilter method is called from AL code and sets a filter to include values greater than ten \\(>10\\), then the SetFilter method overwrites the ColumnFilter property and the resultant filter on the field includes values that are greater than ten and less than fifty \\(10\\< value \\<50\\).\n> NOTE\n> In an SQL SELECT statement, a filter that is set by the DataItemTableFilter property would correspond to a WHERE clause.\n## Example\nThe following example shows how to use the DataItemTableFilter property to filter the data of the Item table, used in the `\"Low on stock inventory items\"` query.\nThe DataItemTableFilter property filters on those records that are physical inventory items (`Type = CONST(Inventory)`), that have less than 20 units in stock (`Inventory = filter(<= 20)`) and for which no substitute item exists (`\"Substitutes Exist\" = const(false)`).\n```al\nquery 50001 \"Low on stock inventory items\"\n{\n    elements\n    {\n        dataitem(item; \"Item\")\n        {\n            DataItemTableFilter = Type = CONST(Inventory), Inventory = FILTER(<= 20),\n            \"Substitutes Exist\" = CONST(False);\n\n            column(Item_No; \"Item No.\")\n            {\n            }\n            column(Description; Description)\n            {\n            }\n        }\n    }\n}\n```\n## Related information\ndevenv-columnfilter-property\nSetFilter Method (Query)<../methods-auto/library>\nSetRange Method (Query\\)<../methods-auto/library>"}