{"title":"AppSourceCop Error AS0135","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0135/","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-as0135, 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-as0135","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":"One-step removal of the external business event is not allowed as it can introduce breaking changes for external subscribers.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0135","slug":"appsourcecop-error-as0135","at":0,"chars":4132},{"level":2,"title":"Description","slug":"description","at":105,"chars":294},{"level":2,"title":"Remarks","slug":"remarks","at":399,"chars":207},{"level":2,"title":"How to fix this diagnostic?","slug":"how-to-fix-this-diagnostic","at":606,"chars":679},{"level":2,"title":"Examples triggering this rule","slug":"examples-triggering-this-rule","at":1285,"chars":1526},{"level":3,"title":"Example 1 - Removing an external business event (independant of the object / procedure accessibilty)","slug":"example-1---removing-an-external-business-event-independant-of-the-object-procedure-accessibilty","at":1318,"chars":397},{"level":3,"title":"Example 2 - Removing an incorrectly obsoleted external business event","slug":"example-2---removing-an-incorrectly-obsoleted-external-business-event","at":1715,"chars":599},{"level":3,"title":"Example 3 - Removing an obsolete object with a non-obsolete external business event","slug":"example-3---removing-an-obsolete-object-with-a-non-obsolete-external-business-event","at":2314,"chars":497},{"level":2,"title":"Examples not triggering this rule","slug":"examples-not-triggering-this-rule","at":2811,"chars":1170},{"level":3,"title":"Example 1 - Removing a correctly obsoleted external business event","slug":"example-1---removing-a-correctly-obsoleted-external-business-event","at":2848,"chars":419},{"level":3,"title":"Example 2 - Moving an external business event from an obsolete codeunit within the same app","slug":"example-2---moving-an-external-business-event-from-an-obsolete-codeunit-within-the-same-app","at":3267,"chars":714},{"level":2,"title":"Related information","slug":"related-information","at":3981,"chars":151}],"text":"# AppSourceCop Error AS0135\nExternal business events must be marked obsolete before they can be removed.\n## Description\nOne-step removal of the external business event is not allowed as it can introduce breaking changes for external subscribers. External business events must be marked obsolete prior to removal. Alternatively, if deprecation was not intended, move the event to a different object.\n## Remarks\nThis rule validates external business events independently of the Accessibility of the containing application object or procedure, because these events are always exposed to external subscribers.\n## How to fix this diagnostic?\nReverting the change will fix this diagnostic.\nIf removing the event is required, the recommended approach is to decorate the procedure with the Obsolete attribute and prefix the display name of the external business event with an `[OBSOLETE]` marker. In a future version, once external subscribers have unsubscribed or changed the trigger of their external processes to a different event, you can remove it.\nAlternatively, if the intention is only to remove the containing object or procedure rather than the event itself, then follow the standard deprecation process for these elements and move the external business event to a different object.\n## Examples triggering this rule\n### Example 1 - Removing an external business event (independant of the object / procedure accessibilty)\nVersion 1 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n    [ExternalBusinessEvent('MyEvent', 'MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    local procedure MyCodeunitEvent()\n    begin\n    end;\n}\n```\nVersion 2 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n}\n```\n### Example 2 - Removing an incorrectly obsoleted external business event\nTo correctly obsolete an external business event, both the Obsolete attribute on the procedure and the `[Obsolete]` prefix in the display name must be present.\nVersion 1 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n    [ExternalBusinessEvent('MyEvent', 'MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    [Obsolete('The event will be replaced by version 2.0 of MyEvent', '27.0')]\n    procedure MyCodeunitEvent()\n    begin\n    end;\n}\n```\nVersion 2 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n}\n```\n### Example 3 - Removing an obsolete object with a non-obsolete external business event\nVersion 1 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'This codeunit will be removed in a future version';\n    ObsoleteTag = '27.0';\n\n    [ExternalBusinessEvent('MyEvent', 'MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    procedure MyCodeunitEvent()\n    begin\n    end;\n}\n```\nVersion 2 of the extension\n```al\n// Removed codeunit\n```\n## Examples not triggering this rule\n### Example 1 - Removing a correctly obsoleted external business event\nVersion 1 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n    [ExternalBusinessEvent('MyEvent', '[OBSOLETE]MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    [Obsolete('The event will be removed', '27.0')]\n    procedure MyCodeunitEvent()\n    begin\n    end;\n}\n```\nVersion 2 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n}\n```\n### Example 2 - Moving an external business event from an obsolete codeunit within the same app\nVersion 1 of the extension\n```al\ncodeunit 10 MyCodeunit\n{\n    ObsoleteState = Pending;\n    ObsoleteReason = 'This codeunit will be replaced by MyNewCodeunit';\n    ObsoleteTag = '27.0';\n\n    [ExternalBusinessEvent('MyEvent', 'MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    local procedure MyCodeunitEvent()\n    begin\n    end;\n}\n\ncodeunit 20 MyNewCodeunit\n{\n}\n```\nVersion 2 of the extension\n```al\ncodeunit 20 MyNewCodeunit\n{\n    [ExternalBusinessEvent('MyEvent', 'MyEventDisplayName', 'Description', EventCategory::MyValue, '1.0')]\n    local procedure MyCodeunitEvent()\n    begin\n    end;\n}\n```\n## Related information\nAppSourceCop analyzer<appsourcecop>\nGetting started with AL<../devenv-get-started>\nDeveloping extensions<../devenv-dev-overview>"}