Script function
Execution of javascript with value insertion into other fields
Properties
- Type: Basic
- Groupable: No
- Show in lists: No
- Searchable: No
User interface
This field is not displayed as a normal field, nor is the value of it saved and available to codeunits/sql-statements.
Due to its nature this field has no special editing mode.
Configuration
This field requires configuration before deployment.
Input
Is a list of fields, which values will be available as variables in the following function.
If a name contains "!", it will be loaded as a decimal.
So this configuration:
FIELD1 FIELD2! !FIELD3
Results is this code:
let FIELD1 = getValue("FIELD1")
let FIELD2 = getDecimal("FIELD2")
let FIELD3 = getDecimal("FIELD3")
Plus all those fields will trigger a re-evaluation of this field, whenever they are updates/changed.
Code (Function)
The actual javascript that modifies the data collected from the inputs.
Is pasted into a function, so should only contain lines of code.
Must have a return statement!
Sample:
return FIELD2 * FIELD3;
Output
The field to set the value of, with the return value of the final function.
The output of the function will also be the value of this field, but will not be saved, as this field is virtual and only works in the frontend.
Developer info
- FeltTypeID: 620
- SQL datatype: N/A
- Class name: FieldContentFunction