Business Central - 'OnCustomDocumentMergerEx' even does not trigger
I Recently tried to refactor a deprecated part of our code, which is an event subscription to 'OnBeforeMergeDocument', Because i had some problems regarding the printer name which I posted about in this Stack Overflow post.
I then tried to bind to the new event using the following code
[EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, 'OnCustomDocumentMergerEx', '', true, true)]
local procedure OnCustomDocumentMergerEx(ObjectID: Integer; ReportAction: Option SaveAsPdf,SaveAsWord,SaveAsExcel,Preview,Print,SaveAsHtml; ObjectPayload: JsonObject; XmlData: InStream; LayoutData: InStream; var DocumentStream: OutStream; var IsHandled: Boolean)
var
Test: Text;
begin
Test := 'test';
IsHandled := true;
end;
Just like the 'OnBeforeMergeDocument' event, i expected it to fire when i preview or print or send a report (for example if you go to business central > posted sales invoices > print/send > print). However it doesnt, and im getting a 'The custom report layout for '' is empty.' why is this? and why doesnt the event fire when I think it would fire?
Comments
Post a Comment