{"title":"QueryCategory Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-querycategory-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-querycategory-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-querycategory-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":"Used to indicate a given query can be made available as views displayed on certain main entity lists.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":343,"chars":27},{"level":2,"title":"Syntax","slug":"syntax","at":370,"chars":1030},{"level":2,"title":"Remarks","slug":"remarks","at":1400,"chars":573},{"level":2,"title":"Related information","slug":"related-information","at":1973,"chars":85}],"text":"> Version: _Available or changed with runtime version 3.0._\nUsed to indicate a given query can be made available as views displayed on certain main entity lists. On queries, the QueryCategory property specifies one or more query categories that the object supports. On pages, QueryCategory specifies the query category that the page supports.\n## Applies to\n Page\n Query\n## Syntax\n```al\nquery 50100 QueryWithCategories\n{\n    QueryType = Normal;\n    QueryCategory = 'Customer', 'Items';\n\n    elements\n    {\n        dataitem(DataItemName; Customer)\n        {\n            column(ColumnName; Name)\n            {\n\n            }\n\n        }\n    }\n\n    var\n        myInt: Integer;\n\n    trigger OnBeforeOpen()\n    begin\n\n    end;\n}\n```\n```al\npage 50111 CustomerSourceTable\n{\n    PageType = List;\n    ApplicationArea = All;\n    UsageCategory = Administration;\n    SourceTable = Customer;\n    QueryCategory = 'Customer';\n\n    layout\n    {\n        area(Content)\n        {\n            group(GroupName)\n            {\n                field(Name; Name)\n                {\n                    ApplicationArea = All;\n\n                }\n            }\n        }\n    }\n\n    actions\n    {\n        area(Processing)\n        {\n            action(ActionName)\n            {\n                ApplicationArea = All;\n\n                trigger OnAction()\n                begin\n\n                end;\n            }\n        }\n    }\n}\n```\n## Remarks\nWith this functionality, you can create your own queries through extensions and then have them assigned to a main list page by setting the QueryCategory property. This way you can direct users to related information based on a query even where the data is not coming from a single table.\nFor the syntax examples above, when page CustomerSourceTable is opened in the client, query QueryWithCategories will be available as a view. QueryWithCategories could also be used on other pages by setting the QueryCategory of the pages to either `'Customer'` or `'Items'`.\n## Related information\ndevenv-properties\n../devenv-query-object\n../devenv-page-object"}