ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

New publisher in CopyAttachments procedure

Open radovandokic opened this issue 2 years ago • 4 comments

Hi, can you please add a new publisher in codeunit 1173 "Document Attachment Mgmt", procedure CopyAttachments? There is a publisher at the start of the procedure, but not at the end, where the ToDocumentAttachment record is created. It can be added on line 1841, before the record is modified: Image

Should look like this: OnBeforeModifyCopiedAttachment(ToDocumentAttachment, FromRecRef, ToRecRef)

[IntegrationEvent(false, false)]
local procedure OnBeforeModifyCopiedAttachment(var ToDocumentAttachment: Record "Document Attachment"; var FromRecRef: RecordRef; var ToRecRef: RecordRef)
begin
end;

Thank you!

Additional context

This publisher would allow us to populate custom fields on the Document Attachment table when attachments are copied from master tables to document tables, like Customer -> Sales Header Internal work item: AB#556910

radovandokic avatar Nov 07 '24 07:11 radovandokic

@radovandokic 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

Yes, I still need it. Thanks

radovandokic avatar Apr 10 '25 09:04 radovandokic

Looking at 26.0 there is an event already there, please use this one OnCopyAttachmentsOnAfterSetToDocumentFilters(ToDocumentAttachment, ToRecRef, ToAttachmentDocumentType, ToNo, ToLineNo);

Image

WaelAbuSeada avatar Apr 16 '25 12:04 WaelAbuSeada

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 16 '25 17:04 JesperSchulz