-
Notifications
You must be signed in to change notification settings - Fork 687
Closed
Closed
Task
Copy link
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an eventships-in-future-updateFix ships in a future updateFix ships in a future update
Description
Why do you need this change?
We want to attach the Service Invoice to the Email when the IssuedReminderHeader is Sent over the Automation.
Describe the request
Hello,
can you please add a new event OnAfterAttachRelatedDocument in procedure AttachRelatedDocumentsBeforeEmailFileInternal in Codeunit 6753 "Send Reminder Event Handler"
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Document-Mailing", 'OnBeforeEmailItemPreparation', '', false, false)]
local procedure AttachRelatedDocumentsBeforeEmailFileInternal(var TempEmailItem: Record "Email Item" temporary; var PostedDocNo: Code[20]; var ReportUsage: Integer)
var
SourceTableList: List of [Integer];
SourceIDList: List of [Guid];
SourceRelationTypeList: List of [Integer];
SourceTableID: Integer;
SourceRelationID: Integer;
SourceID: Guid;
AttachRelatedDocument: Boolean;
I: Integer;
begin
if ReportUsage <> Enum::"Report Selection Usage"::Reminder.AsInteger() then
exit;
if SendRemindersSetup."Attach Invoice Documents" = SendRemindersSetup."Attach Invoice Documents"::No then
exit;
TempEmailItem.GetSourceDocuments(SourceTableList, SourceIDList, SourceRelationTypeList);
for I := 1 to SourceTableList.Count() do begin
SourceTableID := SourceTableList.Get(I);
SourceRelationID := SourceRelationTypeList.Get(I);
SourceID := SourceIDList.Get(I);
if SourceTableID = Database::"Sales Invoice Header" then
if SendRemindersSetup."Attach Invoice Documents" = SendRemindersSetup."Attach Invoice Documents"::All then
AttachRelatedDocument := true
else
AttachRelatedDocument := IsInvoiceOverdue(PostedDocNo, SourceID);
if AttachRelatedDocument then
AttachDocument(TempEmailItem, SourceTableID, SourceRelationID, SourceID);
OnAfterAttachRelatedDocument(TempEmailItem, PostedDocNo, SendRemindersSetup, SourceTableID, SourceRelationID, SourceID, ReportUsage);
end;
end;
[IntegrationEvent(false, false)]
local procedure OnAfterAttachRelatedDocument(var TempEmailItem: Record "Email Item" temporary; var PostedDocNo: Code[20]; SendRemindersSetup: Record "Send Reminders Setup"; SourceTableID: Integer; SourceRelationID: Integer; SourceID: Guid; ReportUsage: Integer)
begin
end;
Internal work item: AB#618288
Metadata
Metadata
Assignees
Labels
SCMGitHub request for SCM areaGitHub request for SCM areaevent-requestRequest for adding an eventRequest for adding an eventships-in-future-updateFix ships in a future updateFix ships in a future update