# AppSourceCop Error AS0077
Adding a var modifier in events is not allowed
## Description
Adding a var modifier in events is not allowed as it might break the runtime behavior of extensions subscribing to it.
## Remarks
This error ensures that the behavior of events remains consistent and predictable. Adding a var modifier to an event parameter can alter how the parameter is handled, potentially causing issues for extensions that subscribe to the event. These extensions might not be designed to handle parameters passed by reference, leading to compatibility issues and runtime errors. Maintaining the original parameter passing mechanism (by value) ensures that the event's behavior remains stable and that dependent extensions continue to function as expected.
## How to fix this diagnostic?
To resolve this error, follow these steps:
1. Locate the event in your code where the var modifier has been added to a parameter.
2. Modify the event definition to remove the var modifier from the parameter.
## Related information
AppSourceCop Analyzer<appsourcecop>
Get Started with AL<../devenv-get-started>
Developing Extensions<../devenv-dev-overview>

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-as0077, 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. https://jonas-paprotka.de/docs/dev-itpro/developer/analyzers/appsourcecop-as0077/
