Description
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
- I will provide a fix for a bug