編輯

共用方式為


OnPostReport (Report) trigger

Version: Available or changed with runtime version 1.0.

Runs after a report is run.

Syntax

trigger OnPostReport()
begin
    ...
end;

Remarks

This trigger is run after all data items are processed. The trigger is not run if the report was stopped manually or by using the Quit before processing had concluded.

Because this trigger is run after the report is processed, you can use it to inform users about the result of the report run. For example, if some records could not be processed, you could inform the user of this using the following code in this trigger.

if ProblemsInReport then  
Message(Text000, NumberOfErrors);  

Create the following global text constant variable.

Text constant ENU value
Text000 '%1 records were not processed'

Because this trigger is run before the End Write Transaction, you can also give the user the opportunity to roll back changes to the database by leaving the report with the Quit Method (Report, XMLport).

Get Started with AL
Developing Extensions
OnPostReport (Report Extension) Trigger
Report Triggers and Runtime Operations