BCApps icon indicating copy to clipboard operation
BCApps copied to clipboard

[Bug]: Adding Filters to the Email Scenario Attachments before they are retrieved EVENT fix (var)

Open DrieVeertien opened this issue 1 year ago • 3 comments

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.

Image

Image

Expected behavior

When setting a filter on the record given by the event, it should remember the filters set.

Steps to reproduce

  1. Breakpoint before the call to the event
  2. Subscribe on the event set your filters
  3. Breakpoint behind event
  4. 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

DrieVeertien avatar Feb 21 '25 11:02 DrieVeertien

@JesperSchulz Hi, do we have any idea when this will be released or in which (hotfix) version this will be available? Thanks!

DrieVeertien avatar Mar 24 '25 09:03 DrieVeertien

@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 avatar Mar 25 '25 09:03 JesperSchulz

@JesperSchulz That is fantastic! Thanks for the quick handling and for the quicker release, very much appreciated!

DrieVeertien avatar Mar 26 '25 10:03 DrieVeertien