Return
Overview
Functions are of two types - one which return a value, and the other which does not.
The return deluge task is used to specify the return value while using a function (which returns a value).
Note:
- The return deluge task can be used only if a return type has been specified while creating the function.
Return
When the function is invoked, the value of the expression specified in the return statement will be returned.
Syntax
return <expression>;
Parameter | Description | |
---|---|---|
<expression> | The expression or variable whose value will be returned. The data-type of the return value should match the data-type defined for the return type. If not, an error will be thrown during runtime. |
This task can be used in the following events
When a record is Created | ||
On Load | No | |
On Validate | No | |
On Success | No | |
On User input | No | |
Subform on add row | No | |
Subform on delete row | No | |
When a record is Created or Edited | ||
On Load | No | |
On Validate | No | |
On Success | No | |
On User input | No | |
Subform on add row | No | |
Subform on delete row | No | |
When a record is Edited | ||
On Load | No | |
On Validate | No | |
On Success | No | |
On User input | No | |
Subform on add row | No | |
Subform on delete row | No | |
When a record is Deleted | ||
On Validate | No | |
On Success | No | |
Other workflow events | ||
On a scheduled date | No | |
During approval process | No | |
During payment process | No | |
In a Custom Function | Yes | |
In an Action item in report | No |
Example
The following function returns the number of days between two given dates
int thisapp.CalculateDays(date sdate, date edate)
{
days = (((edate-sdate)/86400000)).toLong();
return days;
}
{
days = (((edate-sdate)/86400000)).toLong();
return days;
}