{"title":"OnOpenPage (Request Page) trigger","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/triggers-auto/requestpage/devenv-onopenpage-requestpage-trigger/","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/triggers-auto/requestpage/devenv-onopenpage-requestpage-trigger, 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/triggers-auto/requestpage/devenv-onopenpage-requestpage-trigger","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":"Runs after a page is initialized and run.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"OnOpenPage (Request Page) trigger","slug":"onopenpage-request-page-trigger","at":0,"chars":1475},{"level":2,"title":"Syntax","slug":"syntax","at":138,"chars":60},{"level":2,"title":"Remarks","slug":"remarks","at":198,"chars":911},{"level":2,"title":"Related information","slug":"related-information","at":1109,"chars":366}],"text":"# OnOpenPage (Request Page) trigger\n> Version: _Available or changed with runtime version 1.0._\nRuns after a page is initialized and run.\n## Syntax\n```al\ntrigger OnOpenPage()\nbegin\n    ...\nend;\n```\n## Remarks\nThis trigger is executed after the ../page/devenv-oninit-page-trigger.\nYou use the OnOpenPage trigger to change dynamic properties, including those which can only be changed when the page is opened, such as the ../../properties/devenv-visible-property. You can also write to the database from the trigger.\nThe OnOpenPage trigger is the only trigger that can toggle the ../../properties/devenv-visible-property and the property can only be toggled on columns.\nIf an error occurs in the trigger execution, then the page closes.\n> NOTE\n> If you use the ../../methods-auto/record/record-locktable-method in the OnOpenPage trigger, then the table lock will be released when the trigger completes execution and not when the user closes the page.\n> NOTE\n> The OnOpenPage trigger does not support calls to control add-in methods and properties because the trigger is invoked before the page is instantiated.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>\n../page/devenv-onopenpage-page-trigger\nOnOpenPage (Request Page Extension) Trigger<../requestpageextension/devenv-onopenpage-requestpageextension-trigger>\nOnOpenPage (Page Extension) Trigger<../pageextension/devenv-onopenpage-pageextension-trigger>"}