Skip to content

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

Closed
@DrieVeertien

Description

@DrieVeertien

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

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    ApprovedThe issue is approvedIntegrationGitHub request for Integration area

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions