--- title: "Advanced Custom Replacement Report Replacement - Lasernet FO Connector" slug: "advanced-custom-replacement" description: "When report replacement is complicated, and a data structure does not match the original report, you can use a custom class for a replacement report." tags: ["Finance and Operations", "Lasernet FO Connector", "Report Replacement", "Complicated scenarios"] updated: 2026-04-01T14:15:05Z published: 2026-04-01T14:15:05Z canonical: "kb.lasernetgroup.com/advanced-custom-replacement" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # Advanced Custom Replacement ## Complicated Scenarios When report replacement becomes more complicated, and the data structure does not match the original report, an option is available to use a custom class for a replacement report. For more information on creating and using a custom class, consult the [Lasernet FO Connector User Guide](/v1/docs/fo-user-guide-tutorial). The following four methods can be used with replacement reports in the report custom class: ### public void replacementRun(LACReportReplacementBase replacementBase) This method is used to run a replacement report. Write “Execution of report” by specifying the necessary ranges and printout parameters from the original report. By default, the `runReplacementPreProcessed` method is used to run a replacement report. If your custom `runReplacement` method supports only one report run, overwrite `fixedReplacementReportName`. The `replacementBase` parameter is `LACReportReplacementBase` class, and it holds information about the original and replacement reports. You can overwrite this method if you want to obtain custom run code for the replacement report. By default, this method calls the `replacementRunPreProcessed` method for a pre-processed report run. ### protected void replacementRunPreProcessed(LACReportReplacementBase replacementBase) This method starts the replacement report run. It starts only pre-processed reports. By default, this method is called from the `replacementRun()` method. The method gets the pre-processed details record and adds ranges for `CreatedTransactionId` in the replacement report query. It also traverses all print destination settings and collects information after the report has run. The `replacementBase` parameter is `LACReportReplacementBase` class, and it holds information about the original and replacement reports. ### public LACReportName replacementReportNameFixed() This method must return the report name if the `runReplacement` method is designed to run only one report. If specified, only this report is available in the replacement report name lookup. ### public boolean replacementPreRun() This method controls the running of the original report's `preRun` method. If **Pre-processed handing** is used on the replacement report, it means the **SalesInvoiceTmp** table must be built prior to the query-based replacement report run. In such a case, this method will return **true**. If a query-based report does not use any TMP tables created in the `preRun` method, **false** is returned to enhance performance and skip unnecessary steps.