ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] - Codeunit Email Scenario Attach Impl - OnAfterInsertEmailAttachments

Open DanielHaglo opened this issue 1 year ago • 6 comments

Describe the request

local procedure InsertEmailAttachments(EmailScenarioAttachments: Record "Email Scenario Attachments"; var EmailAttachment: Record "Email Attachments"; EmailScenario: Integer) begin EmailAttachment.Id := EmailScenarioAttachments.Id; EmailAttachment."Attachment Name" := EmailScenarioAttachments."Attachment Name"; EmailAttachment."Email Attachment" := EmailScenarioAttachments."Email Attachment"; EmailAttachment.AttachmentDefaultStatus := EmailScenarioAttachments.AttachmentDefaultStatus; EmailAttachment.Scenario := Enum::"Email Scenario".FromInteger(EmailScenario); //NewEvent OnInsertEmailAttachmentsOnBeforeEmailAttachmentInsert(EmailAttachment,EmailScenarioAttachments); //newevent EmailAttachment.Insert(); end;

[IntegrationEvent(false, false)]
local procedure OnInsertEmailAttachmentsOnBeforeEmailAttachmentInsert(var EmailAttachment: Record "Email Attachments";EmailScenarioAttachments: Record "Email Scenario Attachments")
begin
end;

Additional context

there is no init on EmailAttachment record, therefor we need an event to clear values because we have fields on this record. When in page, the EmailAttachment-variable will adopt fields from the record the user is currently on Internal work item: AB#561285

DanielHaglo avatar Dec 23 '24 07:12 DanielHaglo

@DanielHaglo sorry, this fell through the cracks. Can you confirm this is something you still need before I assign an engineer to look into the issue?

Aleyenda avatar Apr 10 '25 09:04 Aleyenda

@DanielHaglo sorry, this fell through the cracks. Can you confirm this is something you still need before I assign an engineer to look into the issue?

Yes please :)

DanielHaglo avatar Apr 11 '25 07:04 DanielHaglo

Hi @DanielHaglo, could you explain in greater detail what you mean the EmailAttachment variable will adopt fields from the record the user is currently on?

The following is my understanding:

  • You have extended upon the EmailAttachment and EmailScenarioAttachment tables
  • You'd like this event to copy those fields over before we do the insert.

My thought for the above would be that we add a Transferfields instead of adding an event. Do clear up my understanding if I'm wrong.

darjoo avatar Apr 15 '25 06:04 darjoo

Hi @DanielHaglo, could you explain in greater detail what you mean the EmailAttachment variable will adopt fields from the record the user is currently on?

The following is my understanding:

  • You have extended upon the EmailAttachment and EmailScenarioAttachment tables
  • You'd like this event to copy those fields over before we do the insert.

My thought for the above would be that we add a Transferfields instead of adding an event. Do clear up my understanding if I'm wrong.

Hi :)

Sure, transferfields would be nice.

DanielHaglo avatar Apr 16 '25 08:04 DanielHaglo

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: .

JesperSchulz avatar Apr 23 '25 09:04 JesperSchulz

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 33353.

JesperSchulz avatar Apr 24 '25 07:04 JesperSchulz