Open NAVRockClimber opened 6 years ago
Remove the property IncludeSender on publisher and make it mandatory on all events so you always have a sender
And instead of making Getter functions make e new property on globel varibels so you can set then to be a property on the object (set;get;) this property should be enabled as default
@AlexanderYakunin Any news on this?
Original ask will be considered for new events. We cannot change already implemented ones. Last comment is enhancement and should be reassigned to Modern Dev team.
I disagree that adding more global variables is ever a solution to anything. I thought old NAV code had proved that well...?
A better idea might be 'argument tables', where a record is passed that contains an arbitrary number of name/value pairs. Doing that while retaining proper type info would require a lot of table objects though. Letting the language support 'structs' could obviate that. Or, to avoid polluting the global namespace with publisher-specific arg tables, make it possible to declare a table within the namespace of the publisher only. Sames goes for structs.
Hi,
this issue is related to this issue 2835.
I find myself quite often in the situation of asking for additional parameters for events in high frequently used codeunits. Just for getting the information in a global variable. I would like to suggest for often frequently used codeunits like 90,80,22,... to enable the include sender property on the event and to add a getter function for a global variable instead of adding the variable as parameter.
This would cause less "noise" by changed events in the codeunits and we partners would have to check less events if they are still working with every release.
Related to my issue 2835 this would look like this.
Current code:
Current publisher:
Sugessted Change / Pattern:
Event Publisher:
Event Call:
Getter functions:
This would enable everybody to get required information from a codeunit and without adding endless parameters to the event publishers