[Bug]: Adding Filters to the Email Scenario Attachments before they are retrieved EVENT fix (var)
Describe the issue
In the codeunit 8902 "Email Scenario Attach Impl." - procedure GetEmailAttachmentsByEmailScenarios(var Result: Record "Email Attachments"; EmailScenario: Integer) there is an event called that has its publisher in the codeunit 8901 Email named OnBeforeGetEmailAttachmentsByEmailScenarios.
The description of this event is: Integration event that allows adding filters to the Email Scenario Attachments before they are retrieved.
This event has a parameter EmailScenarioAttachments: Record "Email Scenario Attachments" but this parameter is not a reference (by var). So every filter set when subscribing to the event is not saved.
Expected behavior
When setting a filter on the record given by the event, it should remember the filters set.
Steps to reproduce
- Breakpoint before the call to the event
- Subscribe on the event set your filters
- Breakpoint behind event
- Check filters (they are not save)
Additional context
The code now:
/// <summary> /// Integration event that allows adding filters to the Email Scenario Attachments before they are retrieved. /// </summary> /// <param name="EmailScenarioAttachments">The record to add filters to.</param> [IntegrationEvent(false, false)] internal procedure OnBeforeGetEmailAttachmentsByEmailScenarios(EmailScenarioAttachments: Record "Email Scenario Attachments") begin end;
Fixed code:
/// <summary> /// Integration event that allows adding filters to the Email Scenario Attachments before they are retrieved. /// </summary> /// <param name="EmailScenarioAttachments">The record to add filters to.</param> [IntegrationEvent(false, false)] internal procedure OnBeforeGetEmailAttachmentsByEmailScenarios(var EmailScenarioAttachments: Record "Email Scenario Attachments") begin end;
I will provide a fix for a bug
- [x] I will provide a fix for a bug
@JesperSchulz Hi, do we have any idea when this will be released or in which (hotfix) version this will be available? Thanks!
@JesperSchulz Hi, do we have any idea when this will be released or in which (hotfix) version this will be available? Thanks!
By default, code merged on GitHub is included in the next major release. In this case, that would be version 27 in October. Given your question though, I assume you'd like the change earlier. I've hence created a back-port work item to port these changes to our 26.x branch. Release will then be with 26.1 in May.
@JesperSchulz That is fantastic! Thanks for the quick handling and for the quicker release, very much appreciated!