ftos.documents.generateByName

IMPORTANT!  
Starting with v24.3.0, this is renamed from callReportByName to ftos.documents.generateByName.

Calls a document report based on the report name.

If you use the date parameter, then you can retrieve a report item that fulfills the following condition: startDate <= date <= endDate. This means that only reports that are valid and not expired are retrieved. If not report meets the condition, then the report marked as default is retrieved.

This is a business logic method for business service components.

Syntax

Copy
method ftos.documents.generateByName(reportName: string, entityId: string, date: any, reportOptions: IReportOptions): string
 
Parameter Description
reportName Name of the document report you wish to call.
entityId Unique internal identifier of the entity record you wish to run the document report on.
date Optional parameter for returning the ID of the report valid at the specified date (yyyy-mm-dd). Available starting with FintechOS v24.0.1.
reportOptions

Optional parameter available starting with FintechOS v24.4.2, that works only with PDFs and lets you provide your own data for filling the PDF. This parameter has the following properties:

Copy
{
  "data": { 
    "placeholder_1": "value1",
    "placeholder_2": "value2",
    "placeholder_3": "value3" 
  },

The data structure is just a list of placeholder values you want to put into the PDF. The keys (placeholder_1, placeholder_2, etc.) are the names of fields/placeholders in the PDF, while the values are whatever you want to fill into those fields (text, numbers, booleans, etc.).

When you use the options parameter, the method uses your key‑value data to generate the report and skips the template’s normal data source.

Examples