Could you please add the following event and make the codeunit Public or add a new facade codeunit that we're able to subscribe to this event?
procedure GetDocSendingProfileForDocRef(var RecRef: RecordRef): Record "Document Sending Profile";
var
SalesHeader: Record "Sales Header";
PurchaseHeader: Record "Purchase Header";
FinChargeMemoHeader: Record "Finance Charge Memo Header";
begin
//+EVENT
IsHandled := false;
OnBeforeGetDocSendingProfileForDocRef(RecRef, DocumentSendingProfile, IsHandled);
if IsHandled then
exit(DocumentSendingProfile);
//-EVENT
case RecRef.Number of
Database::"Sales Header", Database::"Sales Invoice Header", Database::"Sales Cr.Memo Header",
Database::"Service Header", Database::"Service Invoice Header", Database::"Service Cr.Memo Header":
exit(GetDocSendingProfileForCustVend(RecRef.Field(SalesHeader.FieldNo("Bill-to Customer No.")).Value, ''));
Database::"Finance Charge Memo Header", Database::"Issued Fin. Charge Memo Header",
Database::"Reminder Header", Database::"Issued Reminder Header":
exit(GetDocSendingProfileForCustVend(RecRef.Field(FinChargeMemoHeader.FieldNo("Customer No.")).Value, ''));
Database::"Purchase Header", Database::"Purch. Inv. Header", Database::"Purch. Cr. Memo Hdr.":
exit(GetDocSendingProfileForCustVend('', RecRef.Field(PurchaseHeader.FieldNo("Pay-to Vendor No.")).Value));
end;
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGetDocSendingProfileForDocRef(var SourceDocumentHeader: RecordRef; var DocumentSendingProfile: Record "Document Sending Profile"; var IsHandled: Boolean );
begin
end;
Additional context
We would like to use a custom Document Sending Profile for specific Records like Sales Invoice Header.
Internal work item: AB#545264
Describe the request
Could you please add the following event and make the codeunit Public or add a new facade codeunit that we're able to subscribe to this event?
Additional context
We would like to use a custom Document Sending Profile for specific Records like Sales Invoice Header. Internal work item: AB#545264