ftos.documents.generateByName
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
function ftos.documents.generateByName(reportName: string, recordId: string, date: string): void
| Parameter | Description |
|---|---|
reportName
|
Name of the document report you wish to call. |
recordId
|
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). |
The date parameter is available starting with FintechOS v24.0.1.
Examples
In this example, we call the welcomeMessage report, which generates a customized welcome message PDF on the Customers entity, for the customer with the following ID: 656f62dd-60f5-43ba-86d0-ba8c43acd719.
ftos.documents.generateByName('welcomeMessage', '656f62dd-60f5-43ba-86d0-ba8c43acd719');
In this example, we call the welcomeMessage report, which generates a customized welcome message PDF on the Customers entity, for the customer record that is open in the current digital journey.
ftos.documents.generateByName('welcomeMessage', ftos.context.Id);