{"title":"Extending pages previously based on the Date virtual table","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-extend-pages-based-on-date-virtual-table/","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/devenv-extend-pages-based-on-date-virtual-table, 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/devenv-extend-pages-based-on-date-virtual-table","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":"Learn how to extend Business Central pages that previously used the Date virtual table, by extending the buffer table and subscribing to the OnAfterCalcLine event.","date":"2026-08-24","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Extending pages previously based on the Date virtual table","slug":"extending-pages-previously-based-on-the-date-virtual-table","at":0,"chars":3189},{"level":2,"title":"Example","slug":"example","at":548,"chars":2483},{"level":2,"title":"Related information","slug":"related-information","at":3031,"chars":158}],"text":"# Extending pages previously based on the Date virtual table\n> INTRODUCED IN: Business Central 2020 release wave 1\nPages that previously had the Date virtual table as their source table are redesigned to use buffer tables instead. This way, you can extend base application pages such as Item Availability Lines and Res. Availability Lines.\nTo extend such a page, first extend the underlying buffer table. Then create a method that calculates and updates the values of the extended fields, and subscribe it to the OnAfterCalcLine event of the page.\n## Example\nThe following example shows how to add two new fields, `\"Add.-Currency Debit Amount\"` and `\"Add.-Currency Credit Amount\"`, to the G/L Account Balance Lines page, which used to be based on the Date table.\nFirst, create a table extension object<devenv-table-ext-object> and add the two fields, `\"Add.-Currency Debit Amount\"` and `\"Add.-Currency Credit Amount\"`, to the G/L Acc. Balance Buffer source table. Then create a page extension object<devenv-page-ext-object> to display the fields on the G/L Account Balance Lines page, as shown in the following code.\n```al\ntableextension 50001 GLAccBalanceBufferExt extends \"G/L Acc. Balance Buffer\"\n{\n    fields\n    {\n        field(50001; \"Add.-Currency Debit Amount\"; Decimal)\n        {\n\n        }\n        field(50002; \"Add.-Currency Credit Amount\"; Decimal)\n        {\n\n        }\n    }\n}\n\npageextension 50001 GLAccountBalanceLinesExt extends \"G/L Account Balance Lines\"\n{\n    layout\n    {\n        addlast(Control1)\n        {\n\n            field(AddCurrencyDebitAmount; \"Add.-Currency Debit Amount\")\n            {\n\n                ApplicationArea = Basic, Suite;\n                Caption = 'Debit Amount (ACY)';\n            }\n\n            field(AddCurrencyCreditAmount; \"Add.-Currency Credit Amount\")\n            {\n                ApplicationArea = Basic, Suite;\n                Caption = 'Credit Amount (ACY)';\n            }\n        }\n    }\n}\n```\nThe subscriber method GLAccountBalanceLinesOnAfterCalcLine computes the values of the `\"Add.-Currency Credit Amount\"` and `\"Add.-Currency Debit Amount\"` fields and updates the G/L Acc. Balance Buffer table. This method is called when the OnAfterCalcLine event in the G/L Account Balance Lines page is raised.\n```al\ncodeunit 50001 GLAccountBalanceLinesExt\n{\n    // Subscribe to OnAfterCalcLine event\n    [EventSubscriber(ObjectType::Page, Page::\"G/L Account Balance Lines\", 'OnAfterCalcLine', '', false, false)]\n    local procedure GLAccountBalanceLinesOnAfterCalcLine(var GLAccount: Record \"G/L Account\"; var GLAccBalanceBuffer: Record \"G/L Acc. Balance Buffer\")\n    begin\n\n        // Calculate values\n        GLAccount.CalcFields(\"Add.-Currency Credit Amount\", \"Add.-Currency Debit Amount\");\n\n        // Assign calculated values to the new fields of the buffer table\n        GLAccBalanceBuffer.\"Add.-Currency Debit Amount\" := GLAccount.\"Add.-Currency Debit Amount\";\n        GLAccBalanceBuffer.\"Add.-Currency Credit Amount\" := GLAccount.\"Add.-Currency Credit Amount\";\n\n    end;\n}\n```\n## Related information\nPage extension object<devenv-page-ext-object>\ndevenv-page-object\nmethods-auto/record/record-calcfields-method\ndevenv-date-virtual-table"}