{"title":"AppSourceCop Error AS0062","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0062/","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/analyzers/appsourcecop-as0062, 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/analyzers/appsourcecop-as0062","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":"Page controls and actions must use the ApplicationArea property to be visible to users.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0062","slug":"appsourcecop-error-as0062","at":0,"chars":2851},{"level":2,"title":"Description","slug":"description","at":92,"chars":242},{"level":2,"title":"Remarks","slug":"remarks","at":334,"chars":486},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":820,"chars":74},{"level":2,"title":"Code example triggering the rule","slug":"code-example-triggering-the-rule","at":894,"chars":387},{"level":2,"title":"Code example not triggering the rule","slug":"code-example-not-triggering-the-rule","at":1281,"chars":1377},{"level":3,"title":"ApplicationArea property set on each members","slug":"applicationarea-property-set-on-each-members","at":1321,"chars":515},{"level":3,"title":"ApplicationArea property set on the object","slug":"applicationarea-property-set-on-the-object","at":1836,"chars":822},{"level":2,"title":"Related information","slug":"related-information","at":2658,"chars":193}],"text":"# AppSourceCop Error AS0062\nPage controls and actions must use the ApplicationArea property\n## Description\nPage controls and actions must use the ApplicationArea property to be visible to users. From runtime 11.0, you can specify on the application object level the ApplicationArea to use as default for all its controls and actions.\n## Remarks\nApplication areas represent a feature in the system that offers developers, administrators, and users the ability to define differentiated user experiences. They are mapped to controls to show or hide them on page objects to enable more or fewer business scenarios. Controls or actions without application area are not displayed in SaaS.\nThis rule validates that the ApplicationArea property is set on actions and controls. See ../properties/devenv-applicationarea-property.\n## How to fix this diagnostic?\nYou must add the ApplicationArea property.\n## Code example triggering the rule\n```al\npage 50100 MyPage\n{\n    layout\n    {\n        area(Content)\n        {\n            field(MyField; 150) { }\n        }\n    }\n\n    actions\n    {\n        area(Processing)\n        {\n            action(MyAction) { }\n        }\n    }\n}\n```\nThe field MyField and the action MyAction are not valid because they do not have the ApplicationArea property set.\n## Code example not triggering the rule\n### ApplicationArea property set on each members\n```al\npage 50100 MyPage\n{\n    layout\n    {\n        area(Content)\n        {\n            field(MyField; 150)\n            {\n                ApplicationArea = All;\n            }\n        }\n    }\n\n    actions\n    {\n        area(Processing)\n        {\n            action(MyAction)\n            {\n                ApplicationArea = All;\n            }\n        }\n    }\n}\n```\nThe field MyField and the action MyAction are valid because they have the ApplicationArea property set.\n### ApplicationArea property set on the object\nFrom runtime version 10.0, field, part, and action controls without ApplicationArea inherit the ApplicationArea defined on the page/report level.\nThe following code will then not trigger this analyzer diagnostic.\n```al\npage 50100 MyPage\n{\n    ApplicationArea = All;\n\n    layout\n    {\n        area(Content)\n        {\n            field(MyField; 150)\n            {\n                // ApplicationArea is inherited from the page.\n            }\n        }\n    }\n\n    actions\n    {\n        area(Processing)\n        {\n            action(MyAction)\n            {\n                // ApplicationArea is inherited from the page.\n            }\n        }\n    }\n}\n```\n> NOTE\n> This inheritance does not apply to members defined in extension objects like page extensions or report extensions.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>\n../properties/devenv-applicationarea-property"}