importLibrary
Allows you to import an automation script library into a module object.
This is suitable for all modules of business service components.
Syntax
function importLibrary(libraryName: string): any
| Parameter | Description |
|---|---|
libraryName
|
Name of the automation script library. |
Return Value
Returns a JSON object containing the library's contents.
Examples
In this example:
- We import the FTOS.DateTimeUtils automation script library in an module object called dtUtils.
- We use the getDaysNoInMonth function stored in the library to extract the number of days in the current month.
- We add 1 to the output of the getMonth method, because the getDaysNoInMonth function counts the months starting from 1, while the getMonth method counts the months starting from 0.
- We store the number of days of the current month in a variable called daysNo.
var dtUtils = importLibrary('FTOS.DateTimeUtils');
var today = new Date();
var daysNo = dtUtils.FTOS.DateTimeUtils.getDaysNoInMonth(today.getMonth()+1, today.getFullYear());