Event Movement Request CU 9520 OnBeforeSendMailOnWinClient
Please move the event from the current location up before the serverfile is deleted. This enables us to log the sent atachment in an email log:
local procedure SendMailOnWinClient(): Boolean var Mail: Codeunit Mail; FileManagement: Codeunit "File Management"; ClientAttachmentFilePath: Text; ClientAttachmentFullName: Text; begin if Mail.TryInitializeOutlook then with TempEmailItem do begin //>>New Location OnBeforeSendMailOnWinClient(TempEmailItem); //<<New location if "Attachment File Path" <> '' then begin ClientAttachmentFilePath := DownloadPdfOnClient("Attachment File Path"); ClientAttachmentFullName := FileManagement.MoveAndRenameClientFile(ClientAttachmentFilePath, "Attachment Name", ''); end; //Current Location OnBeforeSendMailOnWinClient(TempEmailItem); if Mail.NewMessageAsync("Send to", "Send CC", "Send BCC", Subject, GetBodyText, ClientAttachmentFullName, not HideMailDialog) then begin FileManagement.DeleteClientFile(ClientAttachmentFullName); MailSent := true; exit(true) end; end; exit(false); end;
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.
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.