getReport
Calls a document report and returns the ID of the resulting file that was saved in the file upload location.
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.
Syntax
Copy
function getReport(reportId: string, recordId: string, date: string): string
| Parameter | Description |
|---|---|
reportId
|
Unique internal identifier of the document report you wish to call. |
recordId
|
Unique internal identifier of the 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). |
NOTE
The date parameter is available starting with FintechOS v24.0.1.
The date parameter is available starting with FintechOS v24.0.1.
Return Value
Returns a string containing the saved file's real name.
Examples
In this example:
- We call the 5dd10203-70be-429c-9444-e24b92700b1b report, which generates a customized welcome message PDF on the Customers entity, for the customer with the following ID: 656f62dd-60f5-43ba-86d0-ba8c43acd719.
- We save the name of the resulting file ID in a variable called fileName.
var fileName = getReport('5dd10203-70be-429c-9444-e24b92700b1b', '656f62dd-60f5-43ba-86d0-ba8c43acd719');
In this example:
- We call the 5dd10203-70be-429c-9444-e24b92700b1b report, which generates a customized welcome message PDF on the Customers entity, for the customer record that is open in the current digital journey.
- We save the name of the resulting file ID in a variable called fileName.
var fileName = getReport('5dd10203-70be-429c-9444-e24b92700b1b', context.Id);