Skip to main content

Calc: JavaScript

[DESCRIPTION]Executing Javascripts client AND serverside

NOTE: This feature is currently BETA, and features are subject to change.

Properties

User interface

FieldDue into its nature this field has no special show modeor edit mode.

Configuration

This field requires configuration before deployment.

[INSERT IMAGE]

FieldEdit inthe editvalues modeusing "Manual edit" feature

[INSERT IMAGE]Required:

  • Functional JavaScript (Configuration1)

ConfigurationHelp for syntax

[INSERTThe IMAGE]API currently supports the following language features

  • All standard functions from JavaScript
    • Librarys like Math
  • Support for basic TS form functions
    • getValue( variable )
    • setValue( variable, valueToAssign )
  • Unsupported features include
    • JQuery commands (clientside only)
    • JavaScript IO functions like alert and input
    • JavaScript DOM objects like window and document

Important notice

Some field values are represented differently server and client side, namely date and decimal values

FieldClient side exampleServer side format
Date31/1/20142014-01-31
Decimal1,231.234

Future versions will include these methods callable server and clientside

  • getValueDate( fieldname )
  • getValueDecimal( fieldname )
  • getDateFromString( string )
  • getDecimalFromString( string )

[EventuelExample

beskrivelse
if( afgetValue('NUMBER2') configs]

> 1000 ) setValue('NUMBER1', Math.round( 100 * Math.random() ) );

Developer info

  • FeltTypeID: 83
  • SQL datatype: N/A
  • Class name: FieldJavaScripting