{"title":"HandlerFunctions attribute","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/attributes/devenv-handlerfunctions-attribute/","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/attributes/devenv-handlerfunctions-attribute, 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/attributes/devenv-handlerfunctions-attribute","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":"Specifies the handler methods that are used by the test method.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":124,"chars":134},{"level":2,"title":"Syntax","slug":"syntax","at":258,"chars":296},{"level":3,"title":"Arguments","slug":"arguments","at":317,"chars":237},{"level":2,"title":"Remarks","slug":"remarks","at":554,"chars":1429},{"level":2,"title":"Example","slug":"example","at":1983,"chars":135},{"level":2,"title":"Related information","slug":"related-information","at":2118,"chars":111}],"text":"> Version: _Available or changed with runtime version 1.0._\nSpecifies the handler methods that are used by the test method.\n## Applies to\n Method\n> NOTE\n> The HandlerFunctions attribute can only be set inside codeunits with the SubType property set to Test.\n## Syntax\n```al\n[HandlerFunctions(HandlerNames: Text)]\n```\n### Arguments\nHandlerNames\nType: ../methods-auto/text/text-data-type\nThe names of the handler methods used by the test method.\n> NOTE\n> If the test method uses more than one handler method, separate the handler method names with commas.\n## Remarks\nYou use test codeunits and test methods to test your application. A handler method allows you to automate tests by handling instances when user interaction is required by the code that is being tested. In these instances, the test method calls the handler method, which is run instead of the user interface.\nThe following rules apply to handler methods:\n A handler method must have one of these attributes:\n   devenv-messagehandler-attribute\n   devenv-confirmhandler-attribute\n   devenv-strmenuhandler-attribute\n   devenv-pagehandler-attribute\n   devenv-modalpagehandler-attribute\n   devenv-reporthandler-attribute\n   devenv-requestpagehandler-attribute\n   devenv-sendnotificationhandler-attribute\n   devenv-hyperlinkhandler-attribute\n   devenv-recallnotificationhandler-attribute\n   devenv-sessionsettingshandler-attribute\n   devenv-filterpagehandler-attribute\n   devenv-httpclienthandler-attribute\n A test method can only call handler methods that are defined in the same test codeunit as the test method.\n Every nonoptional handler method that you enter in the HandlerFunctions attribute must be called at least once in the test method. If you execute a test method that has a nonoptional handler method listed that isn't called, then the test fails. Send-notification and recall-notification handlers can be optional.\nLearn more about handler methods in Create handler methods<../devenv-creating-handler-methods>.\n## Example\n```al\n[Test]\n[HandlerFunctions('SendNotificationHandler,MessageHandler')]\nprocedure MyTestFunction()\nbegin\n    ...\nend;\n```\n## Related information\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}