Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removing a var modifier in events is not allowed
Description
Removing a var modifier on a parameter in an event is not allowed as it will break dependent extensions subscribing to it.
Remarks
This error occurs when the var modifier is removed from a parameter in an event. The var modifier indicates that the parameter is passed by reference, allowing the event subscriber to modify the parameter's value. Removing the var modifier changes the parameter to be passed by value, which can break dependent extensions that rely on the original behavior.
How to fix this diagnostic?
To resolve this error, you need to ensure that the var modifier isn't removed from parameters in events. Here are the steps:
- Locate the event in your code where the
varmodifier has been removed from a parameter. - Restore the
varmodifier to the parameter.
Related information
AppSourceCop Analyzer
Get Started with AL
Developing Extensions