ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Page 5620 - Fixed Asset Picture - OnExportFileOnAfterSetExportPath

Open Codey42 opened this issue 4 years ago • 1 comments

Dear ALAppExtensions team,

Through this issue we would like to request adding event publisher OnExportFileOnAfterSetExportPath in Page 5620 Fixed Asset Picture with the following signature:

[IntegrationEvent(false, false)]
local procedure OnExportFileOnAfterSetExportPath(FixedAsset: Record "Fixed Asset",
                                                 var ToFile: Text,
                                                 var ExportPath: Text)
begin
end;

with VAR parameters ToFile and ExportPath. which would be called as follows in action ExportFile:

action(ExportFile)
{
    ApplicationArea = Basic, Suite;
    Caption = 'Export';
    Enabled = DeleteExportEnabled;
    Image = Export;
    ToolTip = 'Export the picture to a file.';

    trigger OnAction()
    var
        FileManagement: Codeunit "File Management";
        ToFile: Text;
        ExportPath: Text;
    begin
        TestField("No.");
        TestField(Description);

        ToFile := StrSubstNo('%1 %2.jpg', "No.", Description);
        ExportPath := TemporaryPath + "No." + Format(Image.MediaId);
        // >>>> New >>>>>>>>>>>>>>>>
        OnExportFileOnAfterSetExportPath(Rec, ToFile, ExportPath);
        // <<<< New <<<<<<<<<<<<<<<<
        Image.ExportFile(ExportPath);

        FileManagement.ExportImage(ExportPath, ToFile);
    end;
}

It is required so that the path format as well as the file name format can be overridden.

Codey42 avatar May 25 '22 14:05 Codey42

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: 41251.

JesperSchulz avatar May 27 '22 08:05 JesperSchulz