New publisher in CopyAttachments procedure
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:
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 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, I still need it. Thanks
Looking at 26.0 there is an event already there, please use this one OnCopyAttachmentsOnAfterSetToDocumentFilters(ToDocumentAttachment, ToRecRef, ToAttachmentDocumentType, ToNo, ToLineNo);
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: