...
You may have multiple script custom fields in the same module, but they cannot read each others values. F.ex. you may have two script custom fields for tasks, lets call them "Total hours" and "Total usage", but you cannot read the value of "Total hours" from the "Total usage" script.
Scripts custom fields are quite slow, don't use them for extensive calculations, it will slow down your system, in particular when doing searches where many objects are displayed at the same time. Performance is usually only a problem when using script custom fields, not when using script plugins. The slow speed is mainly due to the speed of accessing objects in Microbizz.
Custom field
When you create a custom field on of type "text" or "number", you can select a subtype. Select the subtype "Script" and a field for editing the script appears.
The script is run every time the custom field is read. The field cannot be shown in the app, or be read by the API, as the value can be very dynamic and can thus be outdated when the app displays it. The app cannot run the script.
Noice Notice that not all objects that support custom fields also support script custom fields.
...
Operators | |
---|---|
* / % ^ | Arithmetic; notice that it is valid to divide by 0 |
+ - | Arithmetic, but + also works for strings and arrays; a+b means string concatenation is if either a or b is a string |
|| && | & ^ | Boolean and bitwise |
== != < <= >= > === !== | Comparisons, the result is 0 or 1 |
. | Object access |
(bool) (number) (array) (string) (int) | Cast, convert a value to another type of value |
! | Logical negation |
= += -= *= /= &= |= ^= | Assignment |
...