{"title":"AppSourceCop Error AS0019","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0019/","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-as0019, 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-as0019","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":"Removing Event attributes such as IntegrationEvent or BusinessEvent is not allowed because it will break dependent extensions that have subscribed to this event.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0019","slug":"appsourcecop-error-as0019","at":0,"chars":1948},{"level":2,"title":"Description","slug":"description","at":63,"chars":177},{"level":2,"title":"Remarks","slug":"remarks","at":240,"chars":446},{"level":2,"title":"Code examples triggering the rule","slug":"code-examples-triggering-the-rule","at":686,"chars":1115},{"level":2,"title":"Related information","slug":"related-information","at":1801,"chars":147}],"text":"# AppSourceCop Error AS0019\nEvent attributes cannot be removed\n## Description\nRemoving Event attributes such as IntegrationEvent or BusinessEvent is not allowed because it will break dependent extensions that have subscribed to this event.\n## Remarks\nRemoving the event attribute on Business and Integration type events is not allowed, because it will break dependent extensions which are subscribing to them. It is allowed to remove the InternalEvent attribute, as InternalEvents can only be subscribed to from within the same module.\n> NOTE\n> Internal events are also available for the modules specified in the internalsVisibleTo property in your app.json<../devenv-json-files> file.\n## Code examples triggering the rule\nIn the following examples, the version 1.0 of the extension defines a Business type event whose accessibility is not public. This means that this event cannot be raised from other extensions, but it can still be subscribed to from other extensions.\nVersion 1.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    [BusinessEvent(false)]\n    local procedure MyEvent(i: Integer)\n    begin\n    end;\n}\n```\nVersion 2.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    local procedure MyEvent()\n    begin\n    end;\n}\n```\nIn version 2.0, the event attribute has been renamed. If a dependent extension subscribed to this event, this will lead to a compilation error similar to `Object member 'MyEvent' is not an event. (AL0281)`.\nFor example, the following extension compiles when depending on version 1.0, but fails to compile with version 2.0:\n```al\ncodeunit 50120 AnotherCodeunit\n{\n    [EventSubscriber(ObjectType::Codeunit, Codeunit::MyCodeunit, 'MyEvent', '', false, false)]\n    local procedure MyProcedure(i: Integer)\n    begin\n        // Subscriber logic\n    end;\n}\n```\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}