Create list of specific data type
Overview
Create list variables which hold elements of a particular data type only.
Syntax
To declare a string list variable
To declare a Bigint list variable
To declare a Decimal list variable
To declare a Timestamp list variable
To declare a Boolean list variable
Parameter | Description |
---|---|
<variable> | Variable which will hold the list elements. |
Points to keep in mind for each type of list
Data type of the list | Points to keep in mind |
---|---|
Text | Text elements must be enclosed in single or double quotes. Number and Decimal elements can be specified without the quotes, which will be converted into text data-type by default. Date-time elements must be enclosed in single quotes, which will be converted into text data-type by default. Boolean values must be specified with or without single/double quotes, which will be converted into text data-type by default. |
Number | Only whole numbers must be specified with or without single/double quotes. If any other data-type is specified, an error will displayed during runtime. |
Date-time | Date-time values must be specified in single or double quotes. You can specify numbers without quotes, where the number 1 stands for the date-time value 31-Dec-1969 16:00:00, and every increase in 1000 will add 1 second to the date-time value, and every decrease in 1000 will subtract 1 second from the date-time value. So, the number 1000 will return a date-time value of 31-Dec-1969 16:00:01. Specifying number or text elements in single/double quotes will return an error during run-time. If the time value is not specified, 00:00:00 will be set as the time value by default. You can specify any valid date-time format, which will get converted into the format selected in application settings. |
Boolean | You must only specify Boolean values 'True' or 'False' with or without single/double quotes. Any other value within quotes will display an error during runtime. |
Decimal | You can specify numeric values with or without single/double quotes. Date-time values can be specified in single quotes, which will get converted into the equivalent numerical value. The date-time value 31-Dec-1969 16:00:00 stands for the number 1, and every increase in 1 second will add 1000 to the number, and every decrease in 1 second will subtract 1000 from the number. So, the date-time value of 31-Dec-1969 16:00:01 will return the number 1000. If any other data-type is specified, an error will displayed during runtime. |
This task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | Yes | |
On Success | Yes | |
Other workflow events | ||
On a scheduled date | Yes | |
During approval process | Yes | |
During payment process | Yes | |
In a Custom Function | Yes | |
In an Action item in report | Yes |
Examples
1) The following sample snippet adds the equivalent numerical value of the specified date to the list:
var.add('1-Jan-2019'); // adds 1546329600000
2) The following sample snippet adds the number '1' as a string value to the list.
listVar.add(1);