{"title":"AppSourceCop Error AS0025","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0025/","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-as0025, 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-as0025","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":"Parameters cannot be modified, renamed, or removed from Business type and Integration type events, because it will break dependent extensions.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"AppSourceCop Error AS0025","slug":"appsourcecop-error-as0025","at":0,"chars":4276},{"level":2,"title":"Description","slug":"description","at":92,"chars":158},{"level":2,"title":"Remarks","slug":"remarks","at":250,"chars":933},{"level":2,"title":"Code examples triggering the rule","slug":"code-examples-triggering-the-rule","at":1183,"chars":2315},{"level":3,"title":"Example 1 - Removing parameters","slug":"example-1---removing-parameters","at":1616,"chars":803},{"level":3,"title":"Example 2 - Modifying parameters","slug":"example-2---modifying-parameters","at":2419,"chars":567},{"level":3,"title":"Example 3 - Renaming parameters","slug":"example-3---renaming-parameters","at":2986,"chars":512},{"level":2,"title":"Code examples not triggering the rule","slug":"code-examples-not-triggering-the-rule","at":3498,"chars":631},{"level":2,"title":"Related information","slug":"related-information","at":4129,"chars":147}],"text":"# AppSourceCop Error AS0025\nParameters cannot be modified, renamed, or removed from events.\n## Description\nParameters cannot be modified, renamed, or removed from Business type and Integration type events, because it will break dependent extensions.\n## Remarks\nEvents defined in an extension can be referenced from dependent extensions, which can raise them, subscribe to them, or both.\nThe rules appsourcecop-as0023, appsourcecop-as0024, and appsourcecop-as0026 validate against breaking changes in public methods, which includes public events. They are then validating the scenarios around events being raised from dependent extensions.\nThis rule validates that changes on the parameters of Business type and Integration type do not break dependent extensions which subscribe to these events. As an event subscriber can use the parameters passed by the event and references them by name, removing parameters, modifying their type, and renaming them can break dependent extensions.\n> NOTE\n> Dependent extensions can subscribe to these events, even if the events are marked with the local or internal access modifiers. The access modifier only limits the ability to raise the event.\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 can be subscribed to from other extensions, but cannot be raised 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```\n### Example 1 - Removing parameters\nVersion 2.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    [BusinessEvent(false)]\n    local procedure MyEvent()\n    begin\n    end;\n}\n```\nIn the version 2.0, the parameter i of the event has been removed. If a dependent extension subscribed to this event and used i, this will lead to a compilation error similar to `The member referenced by event subscriber 'MyProcedure' parameter 'i' is not found. (AL0282)`.\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### Example 2 - Modifying parameters\nThe dependent extension remains the same as in example 1.\nVersion 2.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    [BusinessEvent(false)]\n    local procedure MyEvent(i: Boolean)\n    begin\n    end;\n}\n```\nIn version 2.0, the type of the parameter i has changed from Integer to Boolean. If a dependent extension subscribed to this event and used i, this will lead to a compilation error similar to `The type of the parameter 'i' on the event subscriber 'MyProcedure' does not match the expected type 'Integer'. (AL0284)`.\n### Example 3 - Renaming parameters\nThe dependent extension remains the same as in example 1.\nVersion 2.0 of the extension:\n```al\ncodeunit 50100 MyCodeunit\n{\n    [BusinessEvent(false)]\n    local procedure MyEvent(j: Integer)\n    begin\n    end;\n}\n```\nIn version 2.0, the parameter i has been renamed to j. If a dependent extension subscribed to this event and used i, this will lead to a compilation error similar to `The member referenced by event subscriber 'MyProcedure' parameter 'i' is not found. (AL0282)`.\n## Code examples not triggering the rule\nFor local or internal events, it is allowed to add parameters to the event.\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    [BusinessEvent(false)]\n    local procedure MyEvent(i: Integer; j: Integer)\n    begin\n    end;\n}\n```\nIn version 2.0, the signature of the event has changed. However, it does not break dependent extensions because event subscribers do not have to use all the parameters defined in the event.\n## Related information\nAppSourceCop Analyzer<appsourcecop>\nGet Started with AL<../devenv-get-started>\nDeveloping Extensions<../devenv-dev-overview>"}