ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 260 - OnBeforeGetAttachmentFileName

Open SteveyN opened this issue 7 years ago • 9 comments

New event in Codeunit 260 Document-Mailing

[IntegrationEvent(false, false)]
local procedure OnBeforeGetAttachmentFileName(Var AttachmentFileName: Text[250]; PostedDocNo: Code[20]; EmailDocumentName: Text[250]; ReportUsage: Integer)
begin
end;

Placed at the beginning of GetAttachmentFileName, before the check:

procedure GetAttachmentFileName(var AttachmentFileName: Text[250]; PostedDocNo: Code[20]; EmailDocumentName: Text[250]; ReportUsage: Integer)
var
    ReportSelections: Record "Report Selections";
begin
    //<< New
    OnBeforeGetAttachmentFileName(AttachmentFileName, PostedDocNo, EmailDocumentName, ReportUsage);
    //>> New

    if AttachmentFileName = '' then

SteveyN avatar Oct 10 '19 14:10 SteveyN

This function already available for extensions, why you need event here? Can you simply call it?

AlexanderYakunin avatar Oct 30 '19 10:10 AlexanderYakunin

So we can set/overwrite the AttachmentFileName when this function is called elsewhere, depending on our own conditions.

SteveyN avatar Oct 30 '19 11:10 SteveyN

Yes, you have all needed parameters in this function

AlexanderYakunin avatar Oct 30 '19 11:10 AlexanderYakunin

I know we have the parameters, I know how the function works, I know it's available for use by extensions.

We don't want to call this function directly, we want to set the AttachmentFileName in the function when it is called by other code. This is part of a solution we have, and at the moment, we have to manually add this event in C/AL for our solution to work.

SteveyN avatar Oct 30 '19 11:10 SteveyN

Assigning to right team: @JesperSchulz, @AndreiPanko

AlexanderYakunin avatar Nov 26 '19 07:11 AlexanderYakunin

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. We will update this issue with information about availability.

bc-ghost avatar Dec 04 '19 15:12 bc-ghost

Thanks for submitting this issue. We will publish a fix for it in the next minor update for release 15.

bc-ghost avatar Dec 05 '19 08:12 bc-ghost

Thanks for submitting this issue. We will publish a fix for it in the next minor update for release 15.

bc-ghost avatar Dec 11 '19 08:12 bc-ghost

Thanks for submitting this issue. We will publish a fix for it in the next minor update for release 15.

bc-ghost avatar Jan 10 '20 12:01 bc-ghost