{"title":"Page.SetTableView(var Record) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/page/page-settableview-method/","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/methods-auto/page/page-settableview-method, 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/methods-auto/page/page-settableview-method","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":"Applies the table view on the current record as the table view for the page, report, or XmlPort.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"Page.SetTableView(var Record) Method","slug":"pagesettableviewvar-record-method","at":0,"chars":1793},{"level":2,"title":"Syntax","slug":"syntax","at":196,"chars":59},{"level":2,"title":"Parameters","slug":"parameters","at":255,"chars":207},{"level":2,"title":"Remarks","slug":"remarks","at":462,"chars":613},{"level":2,"title":"Example","slug":"example","at":1075,"chars":586},{"level":2,"title":"Related information","slug":"related-information","at":1661,"chars":132}],"text":"# Page.SetTableView(var Record) Method\n> Version: _Available or changed with runtime version 1.0._\nApplies the table view on the current record as the table view for the page, report, or XmlPort.\n## Syntax\n```al\n Page.SetTableView(var Record: Record)\n```\n## Parameters\nPage\nType: page-data-type\nAn instance of the page-data-type data type.\nRecord\nType: ../record/record-data-type\nThe record that has a table view that you want to apply to the page or data item.\n## Remarks\nThe table view is the view of the table that you present to the user. You determine what records that the user can see by setting filters, determining the sorting order, and selecting the keys.\nThis method only narrows the view of the table that was set through the ../../properties/devenv-sourcetableview-property of the page or through the ../../properties/devenv-dataitemtableview-property of the data item.\n> IMPORTANT\n> SetTableView is not supported for setting views on subpages from code on table headers. For example, you cannot set a table view on the SalesOrder subpage from the SalesHeader.\n## Example\nThis example is based on the Sales Header table and shows how SetTableView is used for a page object.\n```al\n var\n    SalesHeader: Record \"Sales Header\";\n    SomePage: Page \"Sales List\";\nbegin\n    SalesHeader.SetCurrentKey(\"Document Type\");\n    SalesHeader.SetRange(\"Document Type\",SalesHeader.\"Document Type\"::Order);\n    SomePage.SetTableView(SalesHeader); // Only view sales orders.\n    SomePage.Run;\nend;\n```\nThe page that is reference by the SomePage variable can be any page object that has Sales Header as the value of the ../../properties/devenv-sourcetable-property.\n## Related information\npage-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}